apps menu no longer leaks in some impossible case

SVN revision: 80847
This commit is contained in:
Mike Blumenkrantz 2012-12-13 13:23:38 +00:00
parent ef6267c7c3
commit 5e04704e3e
1 changed files with 3 additions and 2 deletions

View File

@ -345,14 +345,15 @@ _load_menu(const char *path)
Eina_List *apps = NULL, *l;
menu = efreet_menu_parse(path);
if ((!menu) || (!menu->entries)) return NULL;
if ((!menu) || (!menu->entries)) goto end;
EINA_LIST_FOREACH(menu->entries, l, entry)
{
if (entry->type != EFREET_MENU_ENTRY_DESKTOP) continue;
efreet_desktop_ref(entry->desktop);
apps = eina_list_append(apps, entry->desktop);
}
efreet_menu_free(menu);
end:
if (menu) efreet_menu_free(menu);
return apps;
}