]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Use goto to close the policy in rpc_rights_grant_internal()
authorAndreas Schneider <asn@samba.org>
Thu, 2 Nov 2023 07:30:36 +0000 (08:30 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 21 Nov 2023 11:16:37 +0000 (11:16 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/utils/net_rpc_rights.c

index cc77ee15cf55424f4aa9318d1f5a88c700b63a68..4198c710bd998078f6b65e149d57aecc8931fbab 100644 (file)
@@ -525,8 +525,9 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
        rights.count = argc-1;
        rights.names = talloc_array(mem_ctx, struct lsa_StringLarge,
                                    rights.count);
-       if (!rights.names) {
-               return NT_STATUS_NO_MEMORY;
+       if (rights.names == NULL) {
+               status = NT_STATUS_NO_MEMORY;
+               goto done;
        }
 
        for (i=0; i<argc-1; i++) {