Fix mem leak reported by Coverity: If we fail to create a new internal

menu, then free the previously allocated xml file.

NB: Fixes Coverity CID 1039182

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 11:17:13 +01:00
parent 2aa12782b6
commit c04cfde0e5
1 changed files with 5 additions and 1 deletions

View File

@ -569,7 +569,11 @@ efreet_menu_parse(const char *path)
/* split apart the filename and the path */
internal = efreet_menu_internal_new(NULL);
if (!internal) return NULL;
if (!internal)
{
efreet_xml_del(xml);
return NULL;
}
internal->efreet_merged_menus = eina_hash_string_superfast_new(NULL);
internal->efreet_merged_dirs = eina_hash_string_superfast_new(NULL);