diff options
author | Michael Adam <obnox@samba.org> | 2013-02-13 14:58:29 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-02-18 15:55:06 +0100 |
commit | 6385f750f19a00a6ba16a0aec9bb91ab1cfcb2be (patch) | |
tree | fd5e84ff2dac704961b770737b85f1853c1abe73 /source4/torture | |
parent | 6240a7d11e910027b42ac1d31ca13264e90d2266 (diff) | |
download | samba-6385f750f19a00a6ba16a0aec9bb91ab1cfcb2be.tar.gz samba-6385f750f19a00a6ba16a0aec9bb91ab1cfcb2be.tar.bz2 samba-6385f750f19a00a6ba16a0aec9bb91ab1cfcb2be.zip |
s4:torture:smb2: fix segfault on error condition in durable-open.reopen2 test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/durable_open.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index 1afc1c16f9..c783fc310c 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -466,13 +466,15 @@ static bool test_durable_open_reopen2(struct torture_context *tctx, h = &_h; 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); |