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:
parent
ac19b39577
commit
e99d1de3c4
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user