diff options
author | Michael Adam <obnox@samba.org> | 2016-03-15 09:44:06 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-03-22 00:23:22 +0100 |
commit | b0f592d05f66114427b26cd4aeea918e41a2e952 (patch) | |
tree | 52bb2a521ff894613d9494725e8f1c35ba94c7c4 | |
parent | 186cd708291641c507cda0c89cc9c24900634ed2 (diff) | |
download | samba-b0f592d05f66114427b26cd4aeea918e41a2e952.tar.gz |
torture:smb2: fix crashes in smb2.durable-v2-open.reopen1a test
If the test failed too early, we dereferenced tree2 which
was still NULL.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source4/torture/smb2/durable_v2_open.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source4/torture/smb2/durable_v2_open.c b/source4/torture/smb2/durable_v2_open.c index a80506acbdc..de24c8f0daf 100644 --- a/source4/torture/smb2/durable_v2_open.c +++ b/source4/torture/smb2/durable_v2_open.c @@ -644,6 +644,8 @@ bool test_durable_v2_open_reopen1a(struct torture_context *tctx, status = smb2_create(tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED); + TALLOC_FREE(tree); + /* * but a durable reconnect on the new session succeeds: */ @@ -664,13 +666,19 @@ bool test_durable_v2_open_reopen1a(struct torture_context *tctx, h = &_h; done: - if (h != NULL) { - smb2_util_close(tree, *h); + if (tree == NULL) { + tree = tree2; } - smb2_util_unlink(tree, fname); + if (tree != NULL) { + if (h != NULL) { + smb2_util_close(tree, *h); + } - talloc_free(tree); + smb2_util_unlink(tree, fname); + + talloc_free(tree); + } talloc_free(mem_ctx); |