diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-05-02 15:25:04 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-07-24 19:31:37 +0200 |
commit | 0b74cd002c8252746f6f0296d586115cc287ab7e (patch) | |
tree | ab65dca04ee29a18ce7350fae8a4f602d5526e70 /lib/elf_py.c | |
parent | Merge pull request #14076 from chiragshah6/fdev1 (diff) | |
download | frr-0b74cd002c8252746f6f0296d586115cc287ab7e.tar.xz frr-0b74cd002c8252746f6f0296d586115cc287ab7e.zip |
lib: Fix elf_py.c for coverity
David rightly pointed out that having a test for fd > 0 would
technically not be right, but not wrong for this portion of the
code since we know that we would never get a fd = 0 in this section.
In any event let's make coverity happy and move on with our life.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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 d473dc10c..81ca668e7 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; } |