mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
1 changed files with 2 additions and 1 deletions
|
|
@ -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 a new issue