RFC: new testparam check

David Disseldorp ddiss at suse.de
Tue Apr 11 16:53:45 UTC 2017


On Tue, 11 Apr 2017 17:33:19 +0100, Noel Power via samba-technical wrote:

> +	valid_values = str_list_make_v3_const(NULL,
> +					      DEFAULT_NAME_RESOLVE_ORDER,
> +					      NULL);
> +	if (!valid_values) {
> +		DBG_ERR("OOM: failed to make string list from %s\n",
> +			DEFAULT_NAME_RESOLVE_ORDER);
> +		return false;
> +	}
> +	values_to_set = str_list_make_v3_const(lp_ctx->globals->ctx,
> +					       pszParmValue,
> +					       NULL);
> +	if (!values_to_set) {
> +		DBG_ERR("OOM: failed to make string list from %s\n",
> +			pszParmValue);

valid_values should be freed on failure here.

Might as well also change the "if (!X)" pointer checks to
"if (X == NULL)".

> +		return false;
> +	}

Cheers, Davi



More information about the samba-technical mailing list