diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-20 14:27:57 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-20 14:27:57 +1100 |
commit | 2ff2c421d0873a9433bced9d48e50aaad18c93d4 (patch) | |
tree | 50186bacd437c2e7f44fdf450684a0666b7ab868 /source4/torture | |
parent | a1135b28dcc15b0f1495a53ec8f6142605929bed (diff) | |
download | samba-2ff2c421d0873a9433bced9d48e50aaad18c93d4.tar.gz samba-2ff2c421d0873a9433bced9d48e50aaad18c93d4.tar.bz2 samba-2ff2c421d0873a9433bced9d48e50aaad18c93d4.zip |
s4-torture: fixed a fd/mem leak in the RPC-LSA-SECRETS test
This test left a large number of lsa pipes open, which could trigger
the server running out of fds
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/session_key.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source4/torture/rpc/session_key.c b/source4/torture/rpc/session_key.c index 431897ac77..1d3199944d 100644 --- a/source4/torture/rpc/session_key.c +++ b/source4/torture/rpc/session_key.c @@ -148,6 +148,7 @@ static bool test_secrets(struct torture_context *torture, const void *_data) struct dcerpc_binding *binding; const struct secret_settings *settings = (const struct secret_settings *)_data; + NTSTATUS status; lp_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False"); lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False"); @@ -158,24 +159,28 @@ static bool test_secrets(struct torture_context *torture, const void *_data) binding->flags |= settings->bindoptions; - torture_assert_ntstatus_ok(torture, - dcerpc_pipe_connect_b(torture, &p, binding, - &ndr_table_lsarpc, - cmdline_credentials, - torture->ev, - torture->lp_ctx), - "connect"); + status = dcerpc_pipe_connect_b(torture, &p, binding, + &ndr_table_lsarpc, + cmdline_credentials, + torture->ev, + torture->lp_ctx); + + torture_assert_ntstatus_ok(torture, status, "connect"); if (!test_lsa_OpenPolicy2(p, torture, &handle)) { + talloc_free(p); return false; } torture_assert(torture, handle, "OpenPolicy2 failed. This test cannot run against this server"); if (!test_CreateSecret_basic(p, torture, handle)) { + talloc_free(p); return false; } + talloc_free(p); + return true; } |