summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/torture/smb2/smb2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/torture/smb2/smb2.c b/source4/torture/smb2/smb2.c
index de8d400ff8..76c6e2446d 100644
--- a/source4/torture/smb2/smb2.c
+++ b/source4/torture/smb2/smb2.c
@@ -74,24 +74,29 @@ static bool wrap_simple_2smb2_test(struct torture_context *torture_ctx,
struct torture_test *test)
{
bool (*fn) (struct torture_context *, struct smb2_tree *, struct smb2_tree *);
- bool ret;
+ bool ret = false;
struct smb2_tree *tree1;
struct smb2_tree *tree2;
TALLOC_CTX *mem_ctx = talloc_new(torture_ctx);
- if (!torture_smb2_connection(torture_ctx, &tree1) ||
- !torture_smb2_connection(torture_ctx, &tree2)) {
- return false;
+ if (!torture_smb2_connection(torture_ctx, &tree1)) {
+ goto done;
}
talloc_steal(mem_ctx, tree1);
+
+ if (!torture_smb2_connection(torture_ctx, &tree2)) {
+ goto done;
+ }
+
talloc_steal(mem_ctx, tree2);
fn = test->fn;
ret = fn(torture_ctx, tree1, tree2);
+done:
/* the test may already closed some of the connections */
talloc_free(mem_ctx);