On Thu, 9 Sep 2010 01:20:40 +0200
Robert Millan <[email protected]> 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

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to