summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-02-13 15:00:26 +0100
committerStefan Metzmacher <metze@samba.org>2013-02-18 15:55:18 +0100
commitcb9b8975e5a9c032f7c4227c3eafb1ed6ada5e19 (patch)
tree7108800ce55acd439d45cc11d0a1502dfb95e19e /source4/torture
parent6385f750f19a00a6ba16a0aec9bb91ab1cfcb2be (diff)
downloadsamba-cb9b8975e5a9c032f7c4227c3eafb1ed6ada5e19.tar.gz
samba-cb9b8975e5a9c032f7c4227c3eafb1ed6ada5e19.tar.bz2
samba-cb9b8975e5a9c032f7c4227c3eafb1ed6ada5e19.zip
s4:torture:smb2: fix segfault on error condition in the durable-open.reopen2a 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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c
index c783fc310c..ec63c5c3ce 100644
--- a/source4/torture/smb2/durable_open.c
+++ b/source4/torture/smb2/durable_open.c
@@ -541,13 +541,15 @@ static bool test_durable_open_reopen2a(struct torture_context *tctx,
h = &_h;
done:
- if (h != NULL) {
- smb2_util_close(tree, *h);
- }
+ if (tree != NULL) {
+ if (h != NULL) {
+ smb2_util_close(tree, *h);
+ }
- smb2_util_unlink(tree, fname);
+ smb2_util_unlink(tree, fname);
- talloc_free(tree);
+ talloc_free(tree);
+ }
talloc_free(mem_ctx);