]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/wildcard: Add missing free.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:29:19 +0000 (21:29 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:29:19 +0000 (21:29 +0100)
Found by: Coverity scan.

grub-core/commands/wildcard.c

index 2807f806bd4f4caf55be8e256b3e56c7334065c0..d207acfed700091817b3972268cd6eb934673104 100644 (file)
@@ -245,7 +245,10 @@ match_devices_iter (const char *name, void *data)
 
   t = grub_realloc (ctx->devs, sizeof (char*) * (ctx->ndev + 2));
   if (! t)
-    return 1;
+    {
+      grub_free (buffer);
+      return 1;
+    }
 
   ctx->devs = t;
   ctx->devs[ctx->ndev++] = buffer;