diff options
| author | Mark Stapp <mjs.ietf@gmail.com> | 2023-07-26 07:18:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-26 07:18:06 -0400 |
| commit | ec8d9bc8a7cf6fc9a0244b3094f0ccce48d0fb9d (patch) | |
| tree | 5806a90b35d4574cefe9aa8d8baacce0ef8e1de6 /lib/elf_py.c | |
| parent | 11d19d1279c77691628b025b51bcb2eb13fd87c7 (diff) | |
| parent | 0b74cd002c8252746f6f0296d586115cc287ab7e (diff) | |
Merge pull request #13417 from donaldsharp/elf_py_fd_semantics
lib: Fix elf_py.c for coverity
Diffstat (limited to 'lib/elf_py.c')
| -rw-r--r-- | lib/elf_py.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/elf_py.c b/lib/elf_py.c index d473dc10cb..81ca668e70 100644 --- a/lib/elf_py.c +++ b/lib/elf_py.c @@ -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; } |
