In the error handling path, don't call close(fd) if the error we're
handling is that fd = open(foo) is -1. This bug is harmless since close(-1) just returns an error (which the code ignores). Found by: Coverity Prevent(tm) CID: 1503 (in userland test run)
This commit is contained in:
parent
81d8304713
commit
c28f49d439
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169848
@ -403,7 +403,8 @@ syserr: run_err("%s: %s", name, strerror(errno));
|
||||
if (response() < 0)
|
||||
goto next;
|
||||
if ((bp = allocbuf(&buffer, fd, BUFSIZ)) == NULL) {
|
||||
next: (void)close(fd);
|
||||
next: if (fd >= 0)
|
||||
(void)close(fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user