[PATCH] Minor cleanup to libnet_join_member

David Disseldorp ddiss at suse.de
Thu Jan 25 11:11:01 UTC 2018


On Thu, 25 Jan 2018 11:23:26 +0100, Swen Schillig via samba-technical wrote:

>  	status = libnet_JoinDomain(ctx, r2, r2);
>  	if (!NT_STATUS_IS_OK(status)) {
>  		r->out.error_string = talloc_steal(mem_ctx, r2->out.error_string);
> -		talloc_free(tmp_mem);
> -		return status;
> +		goto out;
>  	}
>  
>  	set_secrets = talloc_zero(tmp_mem,
>  				  struct provision_store_self_join_settings);
>  	if (!set_secrets) {
> -		r->out.error_string = NULL;
> -		talloc_free(tmp_mem);
> -		return NT_STATUS_NO_MEMORY;
> +		goto out;
>  	}

This will return NT_STATUS_OK on talloc failure. My preference would be
to explicitly set status immediately prior to each enomem goto.

Cheers, David



More information about the samba-technical mailing list