closedir's return value is not checked in a utility function
of the test_fd_tracker unit test.
1407702 Unchecked return value
If the function returns an error value, the error value may be mistaken for a normal value.
In fd_count: Value returned from a function is not checked for errors before being used (CWE-252)
Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
/* Don't account for the file descriptor opened by opendir(). */
count--;
- closedir(dir);
+ if (closedir(dir)) {
+ perror("# Failed to close test program's self/fd directory file descriptor");
+ }
end:
return count;
}