From: Joseph Sutton Date: Sun, 3 Sep 2023 22:02:28 +0000 (+1200) Subject: s4:auth: Check return values of talloc functions X-Git-Tag: tevent-0.16.0~605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b2e14052c78ecd255cc7d8ef99ed55822ba7e8a;p=thirdparty%2Fsamba.git s4:auth: Check return values of talloc functions Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- 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. */