s4:torture: fix segfault in test_durable_open_open2_oplock()
authorStefan Metzmacher <metze@samba.org>
Wed, 13 Feb 2013 13:11:57 +0000 (14:11 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2013 14:56:20 +0000 (15:56 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source4/torture/smb2/durable_open.c

index eea87470376a65595464c5b49902e286e9308314..e3d9185bdcf64f8cdd693363526bc3744314b8e9 100644 (file)
@@ -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);