aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2019-07-24 23:06:57 +0200
committerPali Rohár <pali.rohar@gmail.com>2019-07-24 23:06:57 +0200
commit242b94ac270098d593c2f03ab21d8ff676c89e91 (patch)
tree01f08f42937e8b47efee41fbb95b1206f3e7bb1d
parent4e17b0832b399136e7992b9407d970e2a9cf3f7d (diff)
downloaddlfcn-win32-242b94ac270098d593c2f03ab21d8ff676c89e91.tar.gz
dlfcn-win32-242b94ac270098d593c2f03ab21d8ff676c89e91.tar.bz2
dlfcn-win32-242b94ac270098d593c2f03ab21d8ff676c89e91.zip
Correctly process malloc() error in dlsym()
malloc() may fail, so propagate this error to caller.
-rw-r--r--dlfcn.c5
1 files changed, 5 insertions, 0 deletions
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 )
439 } 439 }
440 free( modules ); 440 free( modules );
441 } 441 }
442 else
443 {
444 SetLastError( ERROR_NOT_ENOUGH_MEMORY );
445 goto end;
446 }
442 } 447 }
443 } 448 }
444 449