Commit e476c014827446c08430e4ee87c5417dd68150e3

Silvio Traversaro 2019-07-25T16:59:14

Merge pull request #58 from pali/master Correctly process malloc() error in dlsym()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/dlfcn.c b/dlfcn.c
index ec60423..ce06d93 100644
--- a/dlfcn.c
+++ b/dlfcn.c
@@ -439,6 +439,11 @@ void *dlsym( void *handle, const char *name )
                 }
                 free( modules );
             }
+            else
+            {
+                SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+                goto end;
+            }
         }
     }