aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2014-09-25 09:01:12 +0200
committerSebastian Dransfeld <sd@tango.flipp.net>2014-09-25 09:01:12 +0200
commit0f4f0a7e5e412463b6f19aae240828b0995a58f8 (patch)
tree87346b08daffd41941fc212756e33c290c584460
parentefreet: Implement fields added by desktop spec 1.1 (diff)
downloadefl-0f4f0a7e5e412463b6f19aae240828b0995a58f8.tar.gz
efreet: Fix leak on error
If we encountered an error, special hashes in internal desktop struct wasn't free'd.
-rw-r--r--src/lib/efreet/efreet_menu.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c
index dcbd4ab22a..0bd69eb4ca 100644
--- a/src/lib/efreet/efreet_menu.c
+++ b/src/lib/efreet/efreet_menu.c
@@ -651,35 +651,27 @@ efreet_menu_parse(const char *path)
if (!efreet_menu_handle_menu(internal, xml))
{
efreet_xml_del(xml);
- efreet_menu_internal_free(internal);
- return NULL;
+ goto error;
}
efreet_xml_del(xml);
efreet_menu_resolve_moves(internal);
if (!efreet_menu_process_dirs(internal))
- {
- efreet_menu_internal_free(internal);
- return NULL;
- }
+ goto error;
/* handle all .desktops */
if (!efreet_menu_process(internal, 0))
- {
- efreet_menu_internal_free(internal);
- return NULL;
- }
+ goto error;
/* handle menus with only unallocated .desktops */
if (!efreet_menu_process(internal, 1))
- {
- efreet_menu_internal_free(internal);
- return NULL;
- }
+ goto error;
/* layout menu */
entry = efreet_menu_layout_menu(internal);
+
+error:
IF_FREE_HASH(internal->efreet_merged_menus);
IF_FREE_HASH(internal->efreet_merged_dirs);
efreet_menu_internal_free(internal);