diff options
author | Michael Adam <obnox@samba.org> | 2011-10-26 22:48:29 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-28 01:00:00 +0200 |
commit | b343a60ad71a3a6427e62e9f3763e4762fa98544 (patch) | |
tree | 1a846dd95baaf8d6fe36a4b72961ee2361f9d94f /source4/torture | |
parent | a29f7e632f999af51a0e847331af4447b5710d8e (diff) | |
download | samba-b343a60ad71a3a6427e62e9f3763e4762fa98544.tar.gz samba-b343a60ad71a3a6427e62e9f3763e4762fa98544.tar.bz2 samba-b343a60ad71a3a6427e62e9f3763e4762fa98544.zip |
s4:torture:smb2: be leass leaky in wrap_simple_2smb2_test()
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/smb2.c | 13 |
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); |