summaryrefslogtreecommitdiff
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
parent793fd5e84775931cf491bf81ccbbee174feda05c (diff)
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)
651 if (!efreet_menu_handle_menu(internal, xml)) 651 if (!efreet_menu_handle_menu(internal, xml))
652 { 652 {
653 efreet_xml_del(xml); 653 efreet_xml_del(xml);
654 efreet_menu_internal_free(internal); 654 goto error;
655 return NULL;
656 } 655 }
657 efreet_xml_del(xml); 656 efreet_xml_del(xml);
658 657
659 efreet_menu_resolve_moves(internal); 658 efreet_menu_resolve_moves(internal);
660 659
661 if (!efreet_menu_process_dirs(internal)) 660 if (!efreet_menu_process_dirs(internal))
662 { 661 goto error;
663 efreet_menu_internal_free(internal);
664 return NULL;
665 }
666 662
667 /* handle all .desktops */ 663 /* handle all .desktops */
668 if (!efreet_menu_process(internal, 0)) 664 if (!efreet_menu_process(internal, 0))
669 { 665 goto error;
670 efreet_menu_internal_free(internal);
671 return NULL;
672 }
673 666
674 /* handle menus with only unallocated .desktops */ 667 /* handle menus with only unallocated .desktops */
675 if (!efreet_menu_process(internal, 1)) 668 if (!efreet_menu_process(internal, 1))
676 { 669 goto error;
677 efreet_menu_internal_free(internal);
678 return NULL;
679 }
680 670
681 /* layout menu */ 671 /* layout menu */
682 entry = efreet_menu_layout_menu(internal); 672 entry = efreet_menu_layout_menu(internal);
673
674error:
683 IF_FREE_HASH(internal->efreet_merged_menus); 675 IF_FREE_HASH(internal->efreet_merged_menus);
684 IF_FREE_HASH(internal->efreet_merged_dirs); 676 IF_FREE_HASH(internal->efreet_merged_dirs);
685 efreet_menu_internal_free(internal); 677 efreet_menu_internal_free(internal);