diff options
author | Michael Adam <obnox@samba.org> | 2013-02-13 15:01:47 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-02-18 15:55:30 +0100 |
commit | 10fcbc6869dc2803e1c2dd3183c6781f4233550d (patch) | |
tree | b5d7d05c493296291dade18b4c1a35fe3a1401a2 /source4/torture | |
parent | cb9b8975e5a9c032f7c4227c3eafb1ed6ada5e19 (diff) | |
download | samba-10fcbc6869dc2803e1c2dd3183c6781f4233550d.tar.gz samba-10fcbc6869dc2803e1c2dd3183c6781f4233550d.tar.bz2 samba-10fcbc6869dc2803e1c2dd3183c6781f4233550d.zip |
s4:torture:smb2: fix segfault on error condition in the durable-open.reopen3 test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/durable_open.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index ec63c5c3ce..8a1e5c7e27 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -611,13 +611,15 @@ static bool test_durable_open_reopen3(struct torture_context *tctx, CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); done: - if (h != NULL) { - smb2_util_close(tree, *h); - } + if (tree != NULL) { + if (h != NULL) { + smb2_util_close(tree, *h); + } - smb2_util_unlink(tree2, fname); + smb2_util_unlink(tree2, fname); - talloc_free(tree); + talloc_free(tree); + } talloc_free(mem_ctx); |