From a4b1326f0d0382be62bb224ea5532ab3fae1b440 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:33:34 +0300 Subject: [PATCH] gfxmenu: fix memory leak Found by: Coverity scan. CID: 96657 --- grub-core/gfxmenu/gfxmenu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/gfxmenu/gfxmenu.c b/grub-core/gfxmenu/gfxmenu.c index f49fce802..8a17dda2c 100644 --- a/grub-core/gfxmenu/gfxmenu.c +++ b/grub-core/gfxmenu/gfxmenu.c @@ -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"), "theme"); - instance = grub_zalloc (sizeof (*instance)); - if (!instance) - return grub_errno; - err = grub_video_get_info (&mode_info); if (err) return err; + instance = grub_zalloc (sizeof (*instance)); + if (!instance) + return grub_errno; + if (theme_path[0] != '/' && theme_path[0] != '(') { const char *prefix;