From 8deba427e2697501f10e80a2ac0325a657635b92 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 26 Jan 2024 18:07:53 +0100 Subject: [PATCH] s4:libcli/ldap: fix no memory error code in ldap_bind_sasl() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15621 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/libcli/ldap/ldap_bind.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c index 1f7308211b1..51231a615c4 100644 --- a/source4/libcli/ldap/ldap_bind.c +++ b/source4/libcli/ldap/ldap_bind.c @@ -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) {