]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Skip allocation of empty device SIDs array
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 10 Oct 2023 03:19:53 +0000 (16:19 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Oct 2023 23:13:32 +0000 (23:13 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/samdb.c

index 81576829a7506bac782a74c539dd536900073e0f..42375a8437ba58154388581bfebde98dacb49724 100644 (file)
@@ -247,7 +247,7 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx,
                }
        }
 
-       if (authentication_was_compounded) {
+       if (authentication_was_compounded && num_device_sids) {
                ptoken->device_sids = talloc_array(ptoken, struct dom_sid, num_device_sids);
                if (ptoken->device_sids == NULL) {
                        talloc_free(ptoken);