grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gazillon of double-free


From: Colin D Bennett
Subject: Re: gazillon of double-free
Date: Tue, 14 Sep 2010 12:42:24 -0700

On Thu, 9 Sep 2010 01:20:40 +0200
Robert Millan <address@hidden> wrote:

> It seems we have a ton of double-free bugs in label() and
> uuid() routines.
> 
> Take for example grub_ext2_label():
> 
>   data = grub_ext2_mount (disk);
>   if (data)
>     *label = grub_strndup (data->sblock.volume_name, 14);
>   else
>     *label = NULL;
>   grub_free (data);

It is important to distinguish between double-free and free(NULL).
As Vladimir points out, free(NULL) is of course OK, but 
"free(p); free(p);",  where p != NULL, is a double-free and is wrong.

Regards,
Colin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]