]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:replace: Fix NULL issue reported by covscan
authorPavel Filipenský <pfilipen@redhat.com>
Thu, 27 Jan 2022 08:40:28 +0000 (09:40 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 1 Feb 2022 21:09:21 +0000 (21:09 +0000)
Found by covscan. Coding style kept as in the rest of the file.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb  1 21:09:21 UTC 2022 on sn-devel-184

lib/replace/tests/os2_delete.c

index 7c48d1683896a6efb7ae1037700aa67118aa917d..a3e45f7bff3c5f0a37488ae008e30053181130e4 100644 (file)
@@ -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);