diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2023-05-16 11:17:35 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-05-18 01:03:37 +0000 |
commit | 34080e8839a998ed177526129049e0cf2a4bbaf6 (patch) | |
tree | cfae44d49d8a614e446b4fc267927e28ba3a8ec5 | |
parent | 263deae7e2b88ae35646426eb31c76a71623bf72 (diff) | |
download | samba-34080e8839a998ed177526129049e0cf2a4bbaf6.tar.gz |
s4:auth: Fix leak
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source4/auth/sam.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 8bbcfb691f9..508f68189b8 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -503,7 +503,10 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX *mem_ctx, user_info_dc->num_sids = num_sids; user_info_dc->info = info = talloc_zero(user_info_dc, struct auth_user_info); - NT_STATUS_HAVE_NO_MEMORY(user_info_dc->info); + if (user_info_dc->info == NULL) { + talloc_free(user_info_dc); + return NT_STATUS_NO_MEMORY; + } str = ldb_msg_find_attr_as_string(msg, "sAMAccountName", NULL); info->account_name = talloc_strdup(info, str); |