Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.
Change-Id: I421e169275fe323e2b019c6cc5d386289aec07f7
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
NT_STATUS_NOT_OK_RETURN(nt_status);
nt_status = auth_context_set_challenge(auth4_context, auth_context->challenge.data, "auth_samba4");
- NT_STATUS_NOT_OK_RETURN_AND_FREE(nt_status, auth4_context);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ TALLOC_FREE(auth4_context);
+ return nt_status;
+ }
nt_status = auth_check_password(auth4_context, auth4_context, user_info, &user_info_dc);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(nt_status, auth4_context);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ TALLOC_FREE(auth4_context);
+ return nt_status;
+ }
nt_status = auth_convert_user_info_dc_saminfo3(mem_ctx,
user_info_dc,
sids,
session_info_flags,
&session_info->security_token);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(nt_status, tmp_ctx);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ TALLOC_FREE(tmp_ctx);
+ return nt_status;
+ }
session_info->credentials = NULL;
talloc_free(tmp_ctx);
return NT_STATUS_OK;
}
- NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(tmp_ctx);
+ return status;
+ }
switch (acl->version) {
case 1:
ids[1].status = ID_UNKNOWN;
status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, 2);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(tmp_ctx);
+ return status;
+ }
sd->owner_sid = talloc_steal(sd, ids[0].sid);
sd->group_sid = talloc_steal(sd, ids[1].sid);
/* fill in the aces from the parent */
status = pvfs_acl_inherit_aces(pvfs, parent_sd, sd, container);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(tmp_ctx);
+ return status;
+ }
/* if there is nothing to inherit then we fallback to the
default acl */
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
status = dom_sid_split_rid(tmp_ctx, sid, &domain_sid, &rid);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(tmp_ctx);
+ return status;
+ }
domain_admins_sid = dom_sid_add_rid(tmp_ctx, domain_sid, DOMAIN_RID_ADMINS);
if (domain_admins_sid == NULL) {
}
status = dom_sid_split_rid(tmp_ctx, sid, NULL, &rid);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(tmp_ctx);
+ return status;
+ }
if (rid == DOMAIN_RID_ADMINISTRATOR) {
/* assume the administrator has them all */
TALLOC_FREE(wrepl_in->send_queue);
status = wrepl_socket_donate_stream(wrepl_out->sock, &wrepl_in->tstream);
- NT_STATUS_NOT_OK_RETURN_AND_FREE(status, update_state);
+ if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(update_state);
+ return status;
+ }
update_state->wrepl_in = wrepl_in;
update_state->wrepl_out = wrepl_out;