I just had a look at source code file fixincludes/fixincl.c I can see that function test_for_changes makes a call to close near the end of its definition as follows close (read_fd); /* probably redundant, but I'm paranoid */ But around line 1352 of the same file is what appears to be a redundant call to close. test_for_changes (read_fd); close (read_fd); So there seems to be duplicate calls to close on the same file descriptor. Suggest remove the second call to close and re-word the comment, which appears to be wrong, the close is required.
did you discover this with cppcheck or by looking manually?
(In reply to Eric Gallager from comment #1) > did you discover this with cppcheck or by looking manually? Also does -fanalyzer catch this?