summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_rpc.c')
-rw-r--r--source3/utils/net_rpc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index c1d812a8f0..66cb6e6ea6 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -5963,6 +5963,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (!pipe_hnd) {
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -5972,6 +5973,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't open policy handle. Error was %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -5984,6 +5986,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
}
@@ -6003,6 +6006,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't enumerate trusted domains. Error was %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -6024,6 +6028,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't properly close lsa policy handle. Error was %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -6042,6 +6047,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &nt_status);
if (!pipe_hnd) {
DEBUG(0, ("Could not initialise samr pipe. Error was %s\n", nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -6052,6 +6058,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Couldn't open SAMR policy handle. Error was %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -6064,6 +6071,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Couldn't open domain object. Error was %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};
@@ -6082,6 +6090,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't enumerate accounts. Error was: %s\n",
nt_errstr(nt_status)));
+ cli_shutdown(cli);
talloc_destroy(mem_ctx);
return -1;
};