[PATCH] Minor cleanup to libnet_join_member
David Disseldorp
ddiss at suse.de
Thu Jan 25 13:16:28 UTC 2018
On Thu, 25 Jan 2018 13:09:24 +0100, Swen Schillig via samba-technical wrote:
> - NTSTATUS status;
> + NTSTATUS status = NT_STATUS_OK;
...
> status = provision_store_self_join(ctx, ctx->lp_ctx, ctx->event_ctx, set_secrets, &error_string);
> if (!NT_STATUS_IS_OK(status)) {
> if (error_string) {
> @@ -1008,8 +1003,7 @@ NTSTATUS libnet_Join_member(struct libnet_context *ctx,
> "provision_store_self_join failed with %s",
> nt_errstr(status));
> }
> - talloc_free(tmp_mem);
> - return status;
> + goto out;
> }
>
> /* move all out parameter to the callers TALLOC_CTX */
> @@ -1020,7 +1014,8 @@ NTSTATUS libnet_Join_member(struct libnet_context *ctx,
> talloc_reparent(r2, mem_ctx, r2->out.domain_sid);
> r->out.domain_name = r2->out.domain_name;
> talloc_reparent(r2, mem_ctx, r2->out.domain_name);
> +out:
My preference would be to drop the status assignment at the top of the
fn, and keep the "status = NT_STATUS_OK" assignment before the "out"
label. Either way, it looks fine as is.
Reviewed-by: David Disseldorp <ddiss at samba.org>
Cheers, David
More information about the samba-technical
mailing list