grub2/0197-commands-wildcard-Add-missing-free.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

30 lines
806 B
Diff

From 3b1b39c08234ba856ec89748f379bac7c710e11a Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sat, 24 Jan 2015 21:29:19 +0100
Subject: [PATCH 197/506] commands/wildcard: Add missing free.
Found by: Coverity scan.
---
grub-core/commands/wildcard.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c
index 2807f80..d207acf 100644
--- a/grub-core/commands/wildcard.c
+++ b/grub-core/commands/wildcard.c
@@ -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;
--
2.4.3