diff options
author | Chris Michael <cp.michael@samsung.com> | 2017-01-25 08:53:41 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2017-01-25 09:09:38 -0500 |
commit | 8b2ca30eb5bc112b47155cc3694be1aa39b1345f (patch) | |
tree | a31a36902d7995b3436d09f8fe2689e3f424ac78 /src | |
parent | 54655d65a3e0422da163d88094556a972ca57136 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/evas/file/evas_module.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c index 67f565657f..0088b1bf18 100644 --- a/src/lib/evas/file/evas_module.c +++ b/src/lib/evas/file/evas_module.c | |||
@@ -574,7 +574,11 @@ evas_module_find_type(Evas_Module_Type type, const char *name) | |||
574 | em = eina_hash_find(evas_modules[type], name); | 574 | em = eina_hash_find(evas_modules[type], name); |
575 | if (em) | 575 | if (em) |
576 | { | 576 | { |
577 | if (evas_module_load(em)) return em; | 577 | if (evas_module_load(em)) |
578 | { | ||
579 | eina_module_free(en); | ||
580 | return em; | ||
581 | } | ||
578 | } | 582 | } |
579 | 583 | ||
580 | eina_module_free(en); | 584 | eina_module_free(en); |