gfxmenu: fix memory leak

Found by: Coverity scan.
CID: 96657
This commit is contained in:
Andrei Borzenkov 2016-01-12 21:33:34 +03:00
parent dbb0f9fa4f
commit a4b1326f0d

View file

@ -63,14 +63,14 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"),
"theme"); "theme");
instance = grub_zalloc (sizeof (*instance));
if (!instance)
return grub_errno;
err = grub_video_get_info (&mode_info); err = grub_video_get_info (&mode_info);
if (err) if (err)
return err; return err;
instance = grub_zalloc (sizeof (*instance));
if (!instance)
return grub_errno;
if (theme_path[0] != '/' && theme_path[0] != '(') if (theme_path[0] != '/' && theme_path[0] != '(')
{ {
const char *prefix; const char *prefix;