summaryrefslogtreecommitdiff
path: root/lib/elf_py.c
diff options
context:
space:
mode:
authorMark Stapp <mjs.ietf@gmail.com>2023-07-26 07:18:06 -0400
committerGitHub <noreply@github.com>2023-07-26 07:18:06 -0400
commitec8d9bc8a7cf6fc9a0244b3094f0ccce48d0fb9d (patch)
tree5806a90b35d4574cefe9aa8d8baacce0ef8e1de6 /lib/elf_py.c
parent11d19d1279c77691628b025b51bcb2eb13fd87c7 (diff)
parent0b74cd002c8252746f6f0296d586115cc287ab7e (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.c2
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;
}