From: Andrei Borzenkov Date: Sat, 20 Jun 2015 20:38:19 +0000 (+0300) Subject: normal: fix memory leak X-Git-Tag: 2.02-beta3~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=152695d0faefe763b2198048e6f3e905a8c0c786;p=thirdparty%2Fgrub.git normal: fix memory leak Found by: Coverity scan. CID: 96677 --- diff --git a/grub-core/normal/context.c b/grub-core/normal/context.c index 7e0a696f3..ee53d4a68 100644 --- a/grub-core/normal/context.c +++ b/grub-core/normal/context.c @@ -64,7 +64,10 @@ grub_env_new_context (int export_all) return grub_errno; menu = grub_zalloc (sizeof (*menu)); if (! menu) - return grub_errno; + { + grub_free (context); + return grub_errno; + } context->prev = grub_current_context; grub_current_context = context;