Fix wrong condition for error string assignment
authorSwen Schillig <swen@vnet.ibm.com>
Thu, 25 Jan 2018 10:02:15 +0000 (11:02 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Thu, 25 Jan 2018 16:19:12 +0000 (17:19 +0100)
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jan 25 17:19:12 CET 2018 on sn-devel-144

source4/libnet/libnet_join.c

index 9a1e58f..6cd18e0 100644 (file)
@@ -929,7 +929,7 @@ NTSTATUS libnet_Join_member(struct libnet_context *ctx,
        uint32_t acct_type = 0;
        const char *account_name;
        const char *netbios_name;
-       const char *error_string;
+       const char *error_string = NULL;
 
        r->out.error_string = NULL;
 
@@ -1000,7 +1000,7 @@ 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)) {
-               if (r->out.error_string) {
+               if (error_string) {
                        r->out.error_string = talloc_steal(mem_ctx, error_string);
                } else {
                        r->out.error_string