summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/dlopen-tests.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tests/dlopen-tests.c b/src/tests/dlopen-tests.c
index 40e02daa..dd4cc754 100644
--- a/src/tests/dlopen-tests.c
+++ b/src/tests/dlopen-tests.c
@@ -102,7 +102,8 @@ static bool recursive_dlopen(const char **name, int round, char **errmsg)
handle = dlopen(name[round], RTLD_GLOBAL|RTLD_NOW);
if (!handle) {
- asprintf(errmsg, "dlopen() failed: %s", dlerror());
+ if (asprintf(errmsg, "dlopen() failed: %s", dlerror()) == -1)
+ *errmsg = NULL;
return false;
}