diff --git a/ChangeLog b/ChangeLog index 741f0f013..39ec5742e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-03-26 Seth Goldberg + + * grub-core/kern/emu/getroot.c (find_root_device_from_libzfs): Don't + return freed string. + 2011-03-26 Vladimir Serbinenko * grub-core/fs/iso9660.c (grub_iso9660_label): Rtrim the label. diff --git a/grub-core/kern/emu/getroot.c b/grub-core/kern/emu/getroot.c index 110e58b14..1d87442d9 100644 --- a/grub-core/kern/emu/getroot.c +++ b/grub-core/kern/emu/getroot.c @@ -184,7 +184,7 @@ find_root_device_from_mountinfo (const char *dir) static char * find_root_device_from_libzfs (const char *dir) { - char *device; + char *device = NULL; char *poolname; char *poolfs; @@ -225,7 +225,10 @@ find_root_device_from_libzfs (const char *dir) struct stat st; if (stat (device, &st) == 0) - break; + { + device = xstrdup (device); + break; + } device = NULL; }