]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: Check return values of talloc functions
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Sun, 3 Sep 2023 22:02:28 +0000 (10:02 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Sep 2023 21:35:29 +0000 (21:35 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/sam.c

index 5409007722f6be26da81a97c89b0da35e8e4b057..916899c6d9370cbdf54b262b3c1b048d70966852 100644 (file)
@@ -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.
         */