summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSviatoslav Chagaev <sviatoslav.chagaev@gmail.com>2013-09-10 18:23:53 +0300
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-13 12:25:37 +0100
commita548141b172a078dd0073d718da3fb655821860a (patch)
treed4de1250957008d6e3e617c100b596e21f209bf8
parent0fbb33714621dc2553fcd4aba4fe721064081890 (diff)
downloaddbus-a548141b172a078dd0073d718da3fb655821860a.tar.gz
Fix file descriptor leak in _dbus_command_for_pid
Fix a file descriptor not being closed when an error codepath is taken. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69182 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [more specific commit message -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--dbus/dbus-sysdeps-util-unix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 6cff3fe2..bbc3f348 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -1144,6 +1144,7 @@ _dbus_command_for_pid (unsigned long pid,
"Failed to read from \"%s\": %s",
_dbus_string_get_const_data (&path),
_dbus_strerror (errno));
+ _dbus_close (fd, NULL);
goto fail;
}