diff options
author | David King <dking@redhat.com> | 2021-05-20 10:06:07 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-07-19 13:59:44 +0000 |
commit | e4e401127bbd323b220ca07aa08eafd0fb4c0270 (patch) | |
tree | 1ddf3258c82818405631eb28b9fec85acd9ac339 /dbus_bindings/unixfd.c | |
parent | 051022c1c51e917c43be90ed9d70296a2e4576ae (diff) |
unixfd: Close fd in error path
Found by Coverity.
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1938703
Diffstat (limited to 'dbus_bindings/unixfd.c')
-rw-r--r-- | dbus_bindings/unixfd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dbus_bindings/unixfd.c b/dbus_bindings/unixfd.c index f39a0ce..3da9323 100644 --- a/dbus_bindings/unixfd.c +++ b/dbus_bindings/unixfd.c @@ -145,8 +145,10 @@ UnixFd_tp_new(PyTypeObject *cls, PyObject *args, PyObject *kwargs) } self = (UnixFdObject *) cls->tp_alloc(cls, 0); - if (!self) + if (!self) { + close(fd); return NULL; + } self->fd = fd; if (variant_level < 0) { |