summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nsswitch/libwbclient/wbc_async.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nsswitch/libwbclient/wbc_async.c b/nsswitch/libwbclient/wbc_async.c
index 6a572f4203..5f985f9d5a 100644
--- a/nsswitch/libwbclient/wbc_async.c
+++ b/nsswitch/libwbclient/wbc_async.c
@@ -200,10 +200,14 @@ struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx, const char* dir)
result->is_priv = false;
if (dir != NULL) {
- result->dir = dir;
+ result->dir = talloc_strdup(result, dir);
} else {
result->dir = winbindd_socket_dir();
}
+ if (result->dir == NULL) {
+ TALLOC_FREE(result);
+ return NULL;
+ }
return result;
}