Second call of dlerror should return NULL by the POSIX standard.

git-svn-id: svn://kolibrios.org@7851 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Magomed Kostoev (mkostoevr) 2020-04-30 11:01:55 +00:00
parent ef6d8a9089
commit be1d6256c6

View File

@ -85,5 +85,7 @@ int dlclose(void *handle) {
// https://pubs.opengroup.org/onlinepubs/007908799/xsh/dlerror.html // https://pubs.opengroup.org/onlinepubs/007908799/xsh/dlerror.html
char *dlerror(void) { char *dlerror(void) {
return strdup(__error); char *ret = __error ? strdup(__error) : NULL;
__error = NULL;
return ret;
} }