summaryrefslogtreecommitdiff
path: root/source3/utils/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r--source3/utils/net.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 800aeded0a..b3b72e2465 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -277,8 +277,13 @@ struct cli_state *net_make_ipc_connection(unsigned flags)
} else {
nt_status = connect_to_ipc(&cli, &server_ip, server_name);
}
+
SAFE_FREE(server_name);
- return cli;
+ if (NT_STATUS_IS_OK(nt_status)) {
+ return cli;
+ } else {
+ return NULL;
+ }
}
static int net_user(int argc, const char **argv)