diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index db13ad3032f..3c9f91601e6 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -65,6 +65,10 @@ _PUBLIC_ struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx, return NULL; } + if (lp_ctx == NULL) { + return NULL; + } + conn = talloc_zero(mem_ctx, struct ldap_connection); if (conn == NULL) { return NULL;