mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix fd leak. Threads people: does the call above to `access' need to be
underscored as well? PR: 37717 Submitted by: fred@clift.org (slightly modified by me)
This commit is contained in:
parent
b9b03ba0bc
commit
0d84b47e9c
1 changed files with 3 additions and 1 deletions
|
|
@ -316,8 +316,10 @@ struct state * const sp;
|
|||
return -1;
|
||||
if ((fid = _open(name, OPEN_MODE)) == -1)
|
||||
return -1;
|
||||
if ((_fstat(fid, &stab) < 0) || !S_ISREG(stab.st_mode))
|
||||
if ((_fstat(fid, &stab) < 0) || !S_ISREG(stab.st_mode)) {
|
||||
_close(fid);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
{
|
||||
struct tzhead * tzhp;
|
||||
|
|
|
|||
Loading…
Reference in a new issue