normal: fix memory leak

Found by: Coverity scan.
CID: 96677
This commit is contained in:
Andrei Borzenkov 2015-06-20 23:38:19 +03:00
parent e7e05cae8d
commit 152695d0fa

View 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;