1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

s3: Protect tldap_errstr against a NULL ld

This commit is contained in:
Volker Lendecke 2011-02-20 15:08:41 +01:00
parent ac19b39577
commit e99d1de3c4

View File

@ -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");