]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/getroot.c (find_root_device_from_libzfs): Don't return freed...
authorSeth Goldberg <seth.goldberg@oracle.com>
Sat, 26 Mar 2011 22:22:59 +0000 (23:22 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 26 Mar 2011 22:22:59 +0000 (23:22 +0100)
ChangeLog
grub-core/kern/emu/getroot.c

index 741f0f01358b3add234784b698a84c1ad0ec3a08..39ec5742e7b1ae0404d5a77a0a3d3ebc86c902ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-26  Seth Goldberg <seth.goldberg@oracle.com>
+
+       * grub-core/kern/emu/getroot.c (find_root_device_from_libzfs): Don't
+       return freed string.
+
 2011-03-26  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/iso9660.c (grub_iso9660_label): Rtrim the label.
index 110e58b14e6ffec74bc9b9539d72879d3e446c41..1d87442d9e25d41f437e7a6b613f1467bc9225b3 100644 (file)
@@ -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;
       }