summaryrefslogtreecommitdiff
path: root/source4/torture/smb2/durable_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/smb2/durable_open.c')
-rw-r--r--source4/torture/smb2/durable_open.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c
index eea8747037..e3d9185bdc 100644
--- a/source4/torture/smb2/durable_open.c
+++ b/source4/torture/smb2/durable_open.c
@@ -1552,8 +1552,10 @@ static bool test_durable_open_open2_oplock(struct torture_context *tctx,
done:
smb2_util_close(tree2, h2);
smb2_util_unlink(tree2, fname);
- smb2_util_close(tree1, h1);
- smb2_util_unlink(tree1, fname);
+ if (tree1 != NULL) {
+ smb2_util_close(tree1, h1);
+ smb2_util_unlink(tree1, fname);
+ }
talloc_free(tree1);
talloc_free(tree2);