apps menu no longer leaks in some impossible case
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 13 Dec 2012 13:23:38 +0000 (13:23 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 13 Dec 2012 13:23:38 +0000 (13:23 +0000)
SVN revision: 80847

src/modules/conf_applications/e_int_config_apps.c

index bd00e5b..0e2af27 100644 (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;
 }