diff options
author | Michael Adam <obnox@samba.org> | 2012-02-23 23:43:18 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-02-27 02:08:28 +0100 |
commit | 6deec81b8e89e7a525925952159cbb45e5d28647 (patch) | |
tree | 1e81133a0c0d5eab665bca16e3b4bf2753d095e8 /source4 | |
parent | d5cefee6fcb2b06fd25348a057a4eae93a7edf85 (diff) | |
download | samba-6deec81b8e89e7a525925952159cbb45e5d28647.tar.gz samba-6deec81b8e89e7a525925952159cbb45e5d28647.tar.xz samba-6deec81b8e89e7a525925952159cbb45e5d28647.zip |
s4:torture:smb2:durable-open: introduce new variable for the new session
This is to clarify the code.
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/smb2/durable_open.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index d0f7c4e52d..22c0176025 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -529,6 +529,7 @@ bool test_durable_open_reopen4(struct torture_context *tctx, struct smb2_create io1, io2; bool ret = true; struct smb2_transport *transport; + struct smb2_session *session2; struct smb2_tree *tree2; /* Choose a random name in case the state is left a little funky. */ @@ -559,12 +560,18 @@ bool test_durable_open_reopen4(struct torture_context *tctx, status = smb2_logoff(tree->session); CHECK_STATUS(status, NT_STATUS_OK); - if (!torture_smb2_session_setup(tctx, transport, mem_ctx, &tree->session)) { + if (!torture_smb2_session_setup(tctx, transport, mem_ctx, &session2)) { torture_warning(tctx, "session setup failed.\n"); ret = false; goto done; } + /* + * the session setup has talloc-stolen the transport, + * so we can safely free the old tree+session for clarity + */ + TALLOC_FREE(tree); + ZERO_STRUCT(io2); io2.in.fname = fname; io2.in.durable_handle = h; @@ -572,7 +579,7 @@ bool test_durable_open_reopen4(struct torture_context *tctx, status = smb2_create(tree, mem_ctx, &io2); CHECK_STATUS(status, NT_STATUS_NETWORK_NAME_DELETED); - if (!torture_smb2_tree_connect(tctx, tree->session, mem_ctx, &tree2)) { + if (!torture_smb2_tree_connect(tctx, session2, mem_ctx, &tree2)) { torture_warning(tctx, "tree connect failed.\n"); ret = false; goto done; |