mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 11:50:21 +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,7 +1140,8 @@ static PyObject *elffile_load(PyTypeObject *type, PyObject *args,
|
||||
fd = open(filename, O_RDONLY | O_NOCTTY);
|
||||
if (fd < 0 || fstat(fd, &st)) {
|
||||
PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
|
||||
close(fd);
|
||||
if (fd > 0)
|
||||
close(fd);
|
||||
goto out;
|
||||
}
|
||||
w->len = st.st_size;
|
||||
|
Loading…
Reference in New Issue
Block a user