From: Andreas Schneider Date: Mon, 9 Dec 2019 09:35:55 +0000 (+0100) Subject: s3:torture: Do not segfault if cli is NULL X-Git-Tag: ldb-2.1.0~370 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfa0526100575a7684879bb64f5e492c578bef87;p=thirdparty%2Fsamba.git s3:torture: Do not segfault if cli is NULL This can happen if we fail early and cli hasn't been initialized yet. Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Richard Sharpe Reviewed-by: Andrew Bartlett --- diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 01c6c824342..db5d07bf584 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -3342,7 +3342,9 @@ static bool run_locktest12(int dummy) ret = true; done: - torture_close_connection(cli); + if (cli != NULL) { + torture_close_connection(cli); + } return ret; } @@ -3543,7 +3545,9 @@ static bool run_locktest13(int dummy) ret = true; done: - torture_close_connection(cli); + if (cli != NULL) { + torture_close_connection(cli); + } return ret; }