s4:libcli/ldap: ldap4_new_connection() requires a valid lp_ctx
authorStefan Metzmacher <metze@samba.org>
Wed, 17 Apr 2024 19:01:08 +0000 (21:01 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Apr 2024 23:50:33 +0000 (23:50 +0000)
Otherwise we'll crash in a lot of places later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/libcli/ldap/ldap_client.c

index db13ad3032f135b0dea574f52c8301e508084119..3c9f91601e697fa41e51b4502384a25f16805834 100644 (file)
@@ -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;