s3:utils: Add missing NULL check in rpc_fetch_domain_aliases()
authorAndreas Schneider <asn@samba.org>
Mon, 4 Feb 2019 16:23:05 +0000 (17:23 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Feb 2019 23:52:25 +0000 (00:52 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 13 00:52:25 CET 2019 on sn-devel-144

source3/utils/net_rpc.c

index f2d63d2af65e0140ccf75350ea84daad0097ca91..a56190f7be51d6ff20fc74b0ef7ee7d406019254 100644 (file)
@@ -4669,6 +4669,10 @@ static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd,
 
                        if (alias.num_members > 0) {
                                alias.members = SMB_MALLOC_ARRAY(struct dom_sid, alias.num_members);
+                               if (alias.members == NULL) {
+                                       status = NT_STATUS_NO_MEMORY;
+                                       goto done;
+                               }
 
                                for (j = 0; j < alias.num_members; j++)
                                        sid_copy(&alias.members[j],