From 3b1b39c08234ba856ec89748f379bac7c710e11a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 24 Jan 2015 21:29:19 +0100 Subject: [PATCH] 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 2807f806b..d207acfed 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;