This avoids leaving the error string NULL.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May 25 06:28:02 CEST 2017 on sn-devel-144
status = provision_store_self_join(ctx, ctx->lp_ctx, ctx->event_ctx, set_secrets, &error_string);
if (!NT_STATUS_IS_OK(status)) {
- r->out.error_string = talloc_steal(mem_ctx, error_string);
+ if (r->out.error_string) {
+ r->out.error_string = talloc_steal(mem_ctx, error_string);
+ } else {
+ r->out.error_string
+ = talloc_asprintf(mem_ctx,
+ "provision_store_self_join failed with %s",
+ nt_errstr(status));
+ }
talloc_free(tmp_mem);
return status;
}