summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-20 15:08:41 +0100
committerVolker Lendecke <vl@samba.org>2011-02-20 15:59:48 +0100
commite99d1de3c4fe3c1ff678270f51ef7e6d3812e878 (patch)
tree1d1f93e581184103a7ba4d76009a2858bcab5ede
parentac19b3957774193b178f9cb61829384b70fc2126 (diff)
downloadsamba-e99d1de3c4fe3c1ff678270f51ef7e6d3812e878.tar.gz
samba-e99d1de3c4fe3c1ff678270f51ef7e6d3812e878.tar.bz2
samba-e99d1de3c4fe3c1ff678270f51ef7e6d3812e878.zip
s3: Protect tldap_errstr against a NULL ld
-rw-r--r--source3/lib/tldap_util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index b83a1b75f0..8f7ad883ef 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -337,7 +337,9 @@ const char *tldap_errstr(TALLOC_CTX *mem_ctx, struct tldap_context *ld, int rc)
const char *ld_error = NULL;
char *res;
- ld_error = tldap_msg_diagnosticmessage(tldap_ctx_lastmsg(ld));
+ if (ld != NULL) {
+ ld_error = tldap_msg_diagnosticmessage(tldap_ctx_lastmsg(ld));
+ }
res = talloc_asprintf(mem_ctx, "LDAP error %d (%s), %s", rc,
tldap_err2string(rc),
ld_error ? ld_error : "unknown");