From fa6753d6c2f83392e9517bd3cee7d65561fb7c0c Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Tue, 23 May 2017 14:11:35 +1200 Subject: libnet join: Fix error handling on provision_store_self_join failure This avoids leaving the error string NULL. Signed-off-by: Gary Lockyer Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu May 25 06:28:02 CEST 2017 on sn-devel-144 --- source4/libnet/libnet_join.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/libnet') diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index cd747cc5502..0c206444a53 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -1000,7 +1000,14 @@ NTSTATUS libnet_Join_member(struct libnet_context *ctx, 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; } -- cgit v1.2.1