Commit 61ad60f591700cc083b8a310c020554a59374a0a

Silvio Traversaro 2020-03-24T16:54:12

Merge pull request #69 from reborn2266/fix_mmleak fix memory leak in dlsym()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/dlfcn.c b/dlfcn.c
index 2497a39..01e878b 100644
--- a/dlfcn.c
+++ b/dlfcn.c
@@ -432,7 +432,10 @@ void *dlsym( void *handle, const char *name )
                             continue;
                         symbol = GetProcAddress( modules[i], name );
                         if( symbol != NULL )
+                        {
+                            free( modules );
                             goto end;
+                        }
                     }
 
                 }