]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 12 Nov 2011 22:42:49 +0000 (23:42 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 12 Nov 2011 22:42:49 +0000 (23:42 +0100)
ChangeLog
grub-core/kern/emu/hostdisk.c

index 9f5b71fe433c428d3a2e56195190fcb754ace414..1ce25663dbb65f003dd60c4aed847891875fc90d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak.
+
 2011-11-12  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/lvm.h (grub_lvm_pv): Correct start type.
index f537b27599d747e2b5dc170aa1bd2d408b81dfbd..ede765d8340e2d2769aa13c89cdb2a1b13d5ad00 100644 (file)
@@ -1751,7 +1751,10 @@ find_system_device (const char *os_dev, struct stat *st, int convert, int add)
       }
 
   if (!add)
-    return -1;
+    {
+      free (os_disk);
+      return -1;
+    }
 
   if (i == ARRAY_SIZE (map))
     grub_util_error (_("device count exceeds limit"));