forked from enlightenment/efl
evas: Fix resource leak in evas_module_find_type
Coverity reports a resource leak here if we successfully load the evas module as we were never freeing the eina_module here. Previously we would just return the evas module without proper cleanup of the eina_module. This patch fixes the leak by calling eina_module_free if we successfully load the evas module. Fixes CID1367503 @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
54655d65a3
commit
8b2ca30eb5
|
@ -574,7 +574,11 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
|
||||||
em = eina_hash_find(evas_modules[type], name);
|
em = eina_hash_find(evas_modules[type], name);
|
||||||
if (em)
|
if (em)
|
||||||
{
|
{
|
||||||
if (evas_module_load(em)) return em;
|
if (evas_module_load(em))
|
||||||
|
{
|
||||||
|
eina_module_free(en);
|
||||||
|
return em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_module_free(en);
|
eina_module_free(en);
|
||||||
|
|
Loading…
Reference in New Issue