s4:libcli/ldap: fix no memory error code in ldap_bind_sasl()
authorStefan Metzmacher <metze@samba.org>
Fri, 26 Jan 2024 17:07:53 +0000 (18:07 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Apr 2024 23:50:33 +0000 (23:50 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15621

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

index 1f7308211b104e4c175bad49fff86ad52eb32dcf..51231a615c44c6b4ef014c35108f7cc0effc39c4 100644 (file)
@@ -264,7 +264,10 @@ _PUBLIC_ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
        }
 
        tmp_ctx = talloc_new(conn);
-       if (tmp_ctx == NULL) goto failed;
+       if (tmp_ctx == NULL) {
+               status = NT_STATUS_NO_MEMORY;
+               goto failed;
+       }
 
        search = &sasl_mechs_msgs[0]->r.SearchResultEntry;
        if (search->num_attributes != 1) {