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
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);