gfxmenu/icon_manager: Fix null pointer dereference.
Found by: Coverity scan.
This commit is contained in:
parent
a4e33a8b18
commit
bd74a925e5
1 changed files with 4 additions and 2 deletions
|
@ -106,8 +106,10 @@ grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
/* Clear the cache if the theme path has changed. */
|
/* Clear the cache if the theme path has changed. */
|
||||||
if (((mgr->theme_path == 0) != (path == 0))
|
if (mgr->theme_path == 0 && path == 0)
|
||||||
|| (grub_strcmp (mgr->theme_path, path) != 0))
|
return;
|
||||||
|
if (mgr->theme_path == 0 || path == 0
|
||||||
|
|| grub_strcmp (mgr->theme_path, path) != 0)
|
||||||
grub_gfxmenu_icon_manager_clear_cache (mgr);
|
grub_gfxmenu_icon_manager_clear_cache (mgr);
|
||||||
|
|
||||||
grub_free (mgr->theme_path);
|
grub_free (mgr->theme_path);
|
||||||
|
|
Loading…
Reference in a new issue