summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-07-08 11:19:37 +0100
committerChris Michael <cp.michael@samsung.com>2013-07-08 11:19:37 +0100
commitaeb4b7f7b90def0d92c566e9a1288a2dce665bec (patch)
tree3084dc25a6136fec9f37bd49900ed72f923ce64c /src/lib/efreet
parentc04cfde0e5ac391c9006df5410f8314f9d7cce4f (diff)
Fix memleak reported by Coverity: If we fail to allocate a new
internal menu, then free the previously allocated memory for xml file. NB: Fixed Coverity CID 1039183 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_menu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c
index feea57d3ea..098f8c79c8 100644
--- a/src/lib/efreet/efreet_menu.c
+++ b/src/lib/efreet/efreet_menu.c
@@ -1452,7 +1452,11 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
1452 } 1452 }
1453 1453
1454 internal = efreet_menu_internal_new(parent); 1454 internal = efreet_menu_internal_new(parent);
1455 if (!internal) return 0; 1455 if (!internal)
1456 {
1457 efreet_xml_del(merge_xml);
1458 return 0;
1459 }
1456 efreet_menu_path_set(internal, path); 1460 efreet_menu_path_set(internal, path);
1457 efreet_menu_handle_menu(internal, merge_xml); 1461 efreet_menu_handle_menu(internal, merge_xml);
1458 efreet_menu_concatenate(parent, internal); 1462 efreet_menu_concatenate(parent, internal);