summaryrefslogtreecommitdiffstats
path: root/source/utils/net_rpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/utils/net_rpc.c')
-rw-r--r--source/utils/net_rpc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index 9678036d523..34e87ddbd21 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -5683,6 +5683,7 @@ static int rpc_trustdom_establish(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;
}
@@ -5692,6 +5693,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
DEBUG(0, ("Couldn't open policy handle. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
}
@@ -5704,6 +5706,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
}
@@ -5719,6 +5722,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
domain_sid)) {
DEBUG(0, ("Storing password for trusted domain failed.\n"));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
}
@@ -5731,6 +5735,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
DEBUG(0, ("Couldn't close LSA pipe. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
}
@@ -5916,6 +5921,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
/* open \PIPE\lsarpc and open policy handle */
if (!(cli = net_make_ipc_connection(NET_FLAGS_PDC))) {
DEBUG(0, ("Couldn't connect to domain controller\n"));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -5924,6 +5930,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -5933,6 +5940,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
DEBUG(0, ("Couldn't open policy handle. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -5945,6 +5953,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
DEBUG(0, ("LSA Query Info failed. Returned error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
}
@@ -5964,6 +5973,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
DEBUG(0, ("Couldn't enumerate trusted domains. Error was %s\n",
nt_errstr(nt_status)));
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -5975,6 +5985,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
domain_sids[i], trusted_dom_names[i]);
if (!NT_STATUS_IS_OK(nt_status)) {
cli_shutdown(cli);
+ talloc_destroy(mem_ctx);
return -1;
}
};
@@ -5993,6 +6004,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
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;
};
@@ -6052,6 +6064,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
/* open \PIPE\lsarpc and open policy handle */
if (!(cli = net_make_ipc_connection(NET_FLAGS_PDC))) {
DEBUG(0, ("Couldn't connect to domain controller\n"));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6059,6 +6072,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) ));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6067,6 +6081,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)));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6078,6 +6093,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)));
+ talloc_destroy(mem_ctx);
return -1;
}
@@ -6096,6 +6112,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)));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6116,6 +6133,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)));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6133,6 +6151,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)));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6142,6 +6161,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)));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6153,6 +6173,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)));
+ talloc_destroy(mem_ctx);
return -1;
};
@@ -6170,6 +6191,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)));
+ talloc_destroy(mem_ctx);
return -1;
};