summaryrefslogtreecommitdiff
path: root/source3/libsmb/cli_lsarpc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-12-15 01:02:11 +0000
committerJeremy Allison <jra@samba.org>2000-12-15 01:02:11 +0000
commit369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4 (patch)
treee4237cf9927822e2b49faea870dd13012e5a5cb5 /source3/libsmb/cli_lsarpc.c
parent1fc3e43f9b9b431e8499d2ebd7f557b9bf2ff14c (diff)
downloadsamba-369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4.tar.gz
samba-369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4.tar.bz2
samba-369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4.zip
Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open problem. Jeremy. (This used to be commit 0a40bc83e14c69a09948ec09bb6fc5026c4f4c14)
Diffstat (limited to 'source3/libsmb/cli_lsarpc.c')
-rw-r--r--source3/libsmb/cli_lsarpc.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/source3/libsmb/cli_lsarpc.c b/source3/libsmb/cli_lsarpc.c
index 4199ab2648..60fab75cca 100644
--- a/source3/libsmb/cli_lsarpc.c
+++ b/source3/libsmb/cli_lsarpc.c
@@ -109,12 +109,16 @@ uint32 cli_lsa_open_policy(struct cli_state *cli, BOOL sec_qos,
if (!lsa_io_q_open_pol("", &q, &qbuf, 0) ||
!rpc_api_pipe_req(cli, LSA_OPENPOLICY, &qbuf, &rbuf)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
/* Unmarshall response */
if (!lsa_io_r_open_pol("", &r, &rbuf, 0)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -126,6 +130,8 @@ uint32 cli_lsa_open_policy(struct cli_state *cli, BOOL sec_qos,
*hnd = r.pol;
}
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return result;
}
@@ -152,12 +158,16 @@ uint32 cli_lsa_close(struct cli_state *cli, POLICY_HND *hnd)
if (!lsa_io_q_close("", &q, &qbuf, 0) ||
!rpc_api_pipe_req(cli, LSA_CLOSE, &qbuf, &rbuf)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
/* Unmarshall response */
if (!lsa_io_r_close("", &r, &rbuf, 0)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -169,6 +179,8 @@ uint32 cli_lsa_close(struct cli_state *cli, POLICY_HND *hnd)
*hnd = r.pol;
}
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return result;
}
@@ -200,6 +212,8 @@ uint32 cli_lsa_lookup_sids(struct cli_state *cli, POLICY_HND *hnd,
if (!lsa_io_q_lookup_sids("", &q, &qbuf, 0) ||
!rpc_api_pipe_req(cli, LSA_LOOKUPSIDS, &qbuf, &rbuf)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -212,6 +226,8 @@ uint32 cli_lsa_lookup_sids(struct cli_state *cli, POLICY_HND *hnd,
r.names = &t_names;
if (!lsa_io_r_lookup_sids("", &r, &rbuf, 0)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -271,6 +287,9 @@ uint32 cli_lsa_lookup_sids(struct cli_state *cli, POLICY_HND *hnd,
}
done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
return result;
}
@@ -301,6 +320,8 @@ uint32 cli_lsa_lookup_names(struct cli_state *cli, POLICY_HND *hnd,
if (!lsa_io_q_lookup_names("", &q, &qbuf, 0) ||
!rpc_api_pipe_req(cli, LSA_LOOKUPNAMES, &qbuf, &rbuf)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -309,7 +330,9 @@ uint32 cli_lsa_lookup_names(struct cli_state *cli, POLICY_HND *hnd,
ZERO_STRUCT(ref);
r.dom_ref = &ref;
- if (!lsa_io_r_lookup_names(cli->mem_ctx, "", &r, &rbuf, 0)) {
+ if (!lsa_io_r_lookup_names("", &r, &rbuf, 0)) {
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -366,5 +389,8 @@ uint32 cli_lsa_lookup_names(struct cli_state *cli, POLICY_HND *hnd,
}
done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
return result;
}