]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
normal: fix memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:19 +0000 (23:38 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:19 +0000 (23:38 +0300)
Found by: Coverity scan.
CID: 96677

grub-core/normal/context.c

index 7e0a696f33fd76e26550e3d139a6651294c83b97..ee53d4a68e5ef93641b7828d44a88927c3425b9c 100644 (file)
@@ -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;