From: Pavel Filipenský Date: Thu, 27 Jan 2022 08:40:28 +0000 (+0100) Subject: lib:replace: Fix NULL issue reported by covscan X-Git-Tag: tevent-0.12.0~792 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1905c77a080710dc06c9422e2654a6080d21daa5;p=thirdparty%2Fsamba.git lib:replace: Fix NULL issue reported by covscan Found by covscan. Coding style kept as in the rest of the file. Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Feb 1 21:09:21 UTC 2022 on sn-devel-184 --- diff --git a/lib/replace/tests/os2_delete.c b/lib/replace/tests/os2_delete.c index 7c48d168389..a3e45f7bff3 100644 --- a/lib/replace/tests/os2_delete.c +++ b/lib/replace/tests/os2_delete.c @@ -106,7 +106,7 @@ int test_readdir_os2_delete(void) d = opendir(TESTDIR "/test0.txt"); if (d != NULL) FAILED("opendir() on file succeed"); if (errno != ENOTDIR) FAILED("opendir() on file didn't give ENOTDIR"); - closedir(d); + if (d != NULL) closedir(d); d = opendir(TESTDIR);