From 8b2ca30eb5bc112b47155cc3694be1aa39b1345f Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 25 Jan 2017 08:53:41 -0500 Subject: [PATCH] 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 --- src/lib/evas/file/evas_module.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) em = eina_hash_find(evas_modules[type], name); if (em) { - if (evas_module_load(em)) return em; + if (evas_module_load(em)) + { + eina_module_free(en); + return em; + } } eina_module_free(en);