summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-17 12:58:40 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-17 13:04:57 +0200
commit4f7ea152f1dc8d8d6851dbb14773d019a2f7f44f (patch)
tree2c5a95d748898afd56af4066dd0f06d987bdb4b7 /src
parent32613ed8b3ed3a1765b1997c7e325e8493ea198a (diff)
downloadsssd-4f7ea152f1dc8d8d6851dbb14773d019a2f7f44f.tar.gz
sssd-4f7ea152f1dc8d8d6851dbb14773d019a2f7f44f.tar.bz2
sssd-4f7ea152f1dc8d8d6851dbb14773d019a2f7f44f.zip
dlopen-tests: Check result of asprintf
According to asprintf(3) the content off errmsg is undefined on error, lets set it to NULL.
Diffstat (limited to 'src')
-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;
}