bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=185a1f739b9f6b5b1ee44c768e3a470e5528c57e

commit 185a1f739b9f6b5b1ee44c768e3a470e5528c57e
Author: Hosang Kim <hosang12....@samsung.com>
Date:   Wed Oct 10 08:22:57 2018 +0000

    ecore_wl2: fix coverity issue. (Resource Leak)
    
    Module is not freed when eina_module_load is failed.
    Differential Revision: https://phab.enlightenment.org/D7152
---
 src/lib/ecore_wl2/ecore_wl2.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c
index fe447e0cec..81573da85a 100644
--- a/src/lib/ecore_wl2/ecore_wl2.c
+++ b/src/lib/ecore_wl2/ecore_wl2.c
@@ -82,7 +82,14 @@ _ecore_wl2_surface_modules_init(void)
           {
              Eina_Module *local_module = eina_module_new(path);
              EINA_SAFETY_ON_NULL_RETURN_VAL(local_module, EINA_FALSE);
-             EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_module_load(local_module), 
EINA_FALSE);
+
+             if (!eina_module_load(local_module))
+               {
+                  ERR("Cannot load module %s", local_module->file);
+                  eina_module_free(local_module);
+                  local_module = NULL;
+                  return EINA_FALSE;
+               }
              return EINA_TRUE;
           }
      }

-- 


Reply via email to