summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-02-13 15:04:10 +0100
committerStefan Metzmacher <metze@samba.org>2013-02-18 15:55:52 +0100
commit1d3bd45d6177c8af653dbacac934eb2061acf35e (patch)
tree0da6b85a6c84f0cc57c06fb0ce090ac0ce59f09f /source4
parent98b0e909b7b65bee694743617476d4d36fe595a3 (diff)
downloadsamba-1d3bd45d6177c8af653dbacac934eb2061acf35e.tar.gz
samba-1d3bd45d6177c8af653dbacac934eb2061acf35e.tar.bz2
samba-1d3bd45d6177c8af653dbacac934eb2061acf35e.zip
s4:torture:smb2: fix segfault on error condition in the durable-open.delete_on_close1 test
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smb2/durable_open.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c
index df67d77e57..89a6be854b 100644
--- a/source4/torture/smb2/durable_open.c
+++ b/source4/torture/smb2/durable_open.c
@@ -787,13 +787,15 @@ static bool test_durable_open_delete_on_close1(struct torture_context *tctx,
CHECK_VAL(io2.out.oplock_level, smb2_util_oplock_level("b"));
done:
- if (h != NULL) {
- smb2_util_close(tree, *h);
- }
+ if (tree != NULL) {
+ if (h != NULL) {
+ smb2_util_close(tree, *h);
+ }
- smb2_util_unlink(tree, fname);
+ smb2_util_unlink(tree, fname);
- talloc_free(tree);
+ talloc_free(tree);
+ }
talloc_free(mem_ctx);