summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_rpc_join.c')
-rw-r--r--source3/utils/net_rpc_join.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 73ec2e593d..c9fa52a734 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -138,13 +138,16 @@ int net_rpc_join(int argc, const char **argv)
0xe005000b, &user_pol,
&user_rid);
- /* We *must* do this.... don't ask... */
if (!NT_STATUS_IS_OK(result) &&
!NT_STATUS_EQUAL(result, NT_STATUS_USER_EXISTS)) {
d_printf("Create of workstation account failed\n");
goto done;
}
- cli_samr_close(cli, mem_ctx, &user_pol);
+
+ /* We *must* do this.... don't ask... */
+
+ if (NT_STATUS_IS_OK(result))
+ cli_samr_close(cli, mem_ctx, &user_pol);
names = (char *)&acct_name[0];