From: Stefan Metzmacher Date: Wed, 13 Feb 2013 13:11:57 +0000 (+0100) Subject: s4:torture: fix segfault in test_durable_open_open2_oplock() X-Git-Tag: tevent-0.9.18~218 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=295444266d33863e3a8b7c8ffa5d193123db6132;p=thirdparty%2Fsamba.git s4:torture: fix segfault in test_durable_open_open2_oplock() Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index eea87470376..e3d9185bdcf 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -1552,8 +1552,10 @@ static bool test_durable_open_open2_oplock(struct torture_context *tctx, done: smb2_util_close(tree2, h2); smb2_util_unlink(tree2, fname); - smb2_util_close(tree1, h1); - smb2_util_unlink(tree1, fname); + if (tree1 != NULL) { + smb2_util_close(tree1, h1); + smb2_util_unlink(tree1, fname); + } talloc_free(tree1); talloc_free(tree2);