cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=00a3de5c1f3268c9b7c98e5be39c3947b105ee6e

commit 00a3de5c1f3268c9b7c98e5be39c3947b105ee6e
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Sun Apr 26 16:38:10 2015 +0200

    evil: fix mem leak in dlsym() when using UNICODE
    
    @fix
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/evil/dlfcn.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lib/evil/dlfcn.c b/src/lib/evil/dlfcn.c
index 4efc91b..c220003 100644
--- a/src/lib/evil/dlfcn.c
+++ b/src/lib/evil/dlfcn.c
@@ -144,7 +144,13 @@ dlsym(void *handle, const char *symbol)
         /* TODO: use EnumProcessModulesEx() on Windows >= Vista */
         if (!EnumProcessModules(GetCurrentProcess(),
                                 modules, sizeof(modules), &needed))
-          return NULL;
+          {
+#ifdef UNICODE
+             _dl_get_last_error("EnumProcessModules returned: ");
+             free((void *)new_symbol);
+#endif /* UNICODE */
+             return NULL;
+          }
 
         for (i = 0; i < (needed / sizeof(HMODULE)); i++)
           {

-- 


Reply via email to