mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 17:42:20 +00:00
lib: Make coverity happy about close
The error condition handled both failure to open and a fstat failure. Just double check that the close is appropriate to call. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
6f99cfcd89
commit
a7209c2dbc
@ -1140,6 +1140,7 @@ static PyObject *elffile_load(PyTypeObject *type, PyObject *args,
|
|||||||
fd = open(filename, O_RDONLY | O_NOCTTY);
|
fd = open(filename, O_RDONLY | O_NOCTTY);
|
||||||
if (fd < 0 || fstat(fd, &st)) {
|
if (fd < 0 || fstat(fd, &st)) {
|
||||||
PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
|
PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
|
||||||
|
if (fd > 0)
|
||||||
close(fd);
|
close(fd);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user