]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
grub-install: Fix memory leak.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:55:30 +0000 (09:55 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:55:30 +0000 (09:55 +0100)
Found by: Coverity scan.

util/grub-install.c

index 7d61c32be2fc6b98f3a5e7c963b1e523f3e3c2ae..afbc55707db4ee2ea3745cb042db732d4c69c2ef 100644 (file)
@@ -622,7 +622,10 @@ device_map_check_duplicates (const char *dev_map)
 
   fp = grub_util_fopen (dev_map, "r");
   if (! fp)
-    return;
+    {
+      free (d);
+      return;
+    }
 
   while (fgets (buf, sizeof (buf), fp))
     {