summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-17 12:58:40 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-17 13:38:51 +0200
commit569bbc59e4060160a986d0fea31601a7b7d998fe (patch)
tree452fd373fca84471597b937ae6e0a7ff47da7174
parent4ba716f4808d9ab2cd8e95916dd61309c31e2111 (diff)
downloadsssd-569bbc59e4060160a986d0fea31601a7b7d998fe.zip
sssd-569bbc59e4060160a986d0fea31601a7b7d998fe.tar.gz
sssd-569bbc59e4060160a986d0fea31601a7b7d998fe.tar.bz2
dlopen-tests: Check the result of asprintf
According to asprintf(3) the content off errmsg is undefined on error, lets set it to NULL.
-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 40e02da..dd4cc75 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;
}