From: Andreas Schneider Date: Thu, 2 Nov 2023 07:30:36 +0000 (+0100) Subject: s3:utils: Use goto to close the policy in rpc_rights_grant_internal() X-Git-Tag: talloc-2.4.2~593 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28e7a754c8d0d49729f6a85bdbfc02b1a7a023f5;p=thirdparty%2Fsamba.git s3:utils: Use goto to close the policy in rpc_rights_grant_internal() Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c index cc77ee15cf5..4198c710bd9 100644 --- a/source3/utils/net_rpc_rights.c +++ b/source3/utils/net_rpc_rights.c @@ -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