mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-24 19:59:34 +00:00
Merge pull request #13417 from donaldsharp/elf_py_fd_semantics
lib: Fix elf_py.c for coverity
This commit is contained in:
commit
ec8d9bc8a7
@ -1140,7 +1140,7 @@ 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);
|
||||
if (fd > 0)
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user