From 8b2e14052c78ecd255cc7d8ef99ed55822ba7e8a Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Mon, 4 Sep 2023 10:02:28 +1200 Subject: [PATCH] s4:auth: Check return values of talloc functions Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/auth/sam.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 5409007722f..916899c6d93 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -322,6 +322,9 @@ static NTSTATUS authsam_domain_group_filter(TALLOC_CTX *mem_ctx, *_filter = NULL; filter = talloc_strdup(mem_ctx, "(&(objectClass=group)"); + if (filter == NULL) { + return NT_STATUS_NO_MEMORY; + } /* * Skip all builtin groups, they're added later. @@ -329,6 +332,9 @@ static NTSTATUS authsam_domain_group_filter(TALLOC_CTX *mem_ctx, talloc_asprintf_addbuf(&filter, "(!(groupType:"LDB_OID_COMPARATOR_AND":=%u))", GROUP_TYPE_BUILTIN_LOCAL_GROUP); + if (filter == NULL) { + return NT_STATUS_NO_MEMORY; + } /* * Only include security groups. */ -- 2.47.3