s4:torture:smb2: avoid leaking tree connects up to the main function from the durable...
authorMichael Adam <obnox@samba.org>
Thu, 27 Oct 2011 22:11:08 +0000 (00:11 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 28 Oct 2011 00:37:25 +0000 (02:37 +0200)
The tree connects are handed in from the calling wrapper.
Those that are freed and reconnected inside the test function
can not be freed in the wrapper and stick to the torture_context
until this is released in the main function.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Oct 28 02:37:25 CEST 2011 on sn-devel-104

source4/torture/smb2/durable_open.c

index 7a85443f256bfdf67605d803649d633f0470b3be..544f404047a32b9de7da9e9ebba5fd6278484c5a 100644 (file)
@@ -164,6 +164,9 @@ bool test_durable_open_file_position(struct torture_context *tctx,
 
        smb2_util_unlink(tree2, fname);
 done:
+       talloc_free(tree1);
+       talloc_free(tree2);
+
        return ret;
 }
 
@@ -249,6 +252,9 @@ bool test_durable_open_oplock(struct torture_context *tctx,
        smb2_util_close(tree2, h2);
        smb2_util_unlink(tree2, fname);
 
+       talloc_free(tree1);
+       talloc_free(tree2);
+
        return ret;
 }
 
@@ -362,6 +368,9 @@ bool test_durable_open_lease(struct torture_context *tctx,
        smb2_util_close(tree2, h2);
        smb2_util_unlink(tree2, fname);
 
+       talloc_free(tree1);
+       talloc_free(tree2);
+
        return ret;
 }
 
@@ -469,6 +478,7 @@ bool test_durable_open_lock(struct torture_context *tctx,
  done:
        smb2_util_close(tree, h);
        smb2_util_unlink(tree, fname);
+       talloc_free(tree);
 
        return ret;
 }
@@ -580,6 +590,9 @@ bool test_durable_open_open(struct torture_context *tctx,
        smb2_util_close(tree1, h1);
        smb2_util_unlink(tree1, fname);
 
+       talloc_free(tree1);
+       talloc_free(tree2);
+
        return ret;
 }