diff options
author | Alban Crequy <alban.crequy@collabora.co.uk> | 2014-06-27 16:33:39 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-09-15 17:37:34 +0100 |
commit | eb4584d5c53fe63d7efdf22639d58022ed853305 (patch) | |
tree | c8ae522323b47c70c932e5d5d4c2cfb74cb4a28f | |
parent | 6864780bd6db9c46bcdd4653871a7d328eb200bf (diff) | |
download | dbus-eb4584d5c53fe63d7efdf22639d58022ed853305.tar.gz |
dbus-monitor: do not leak file descriptors from fd-passing
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80603
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | tools/dbus-print-message.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c index e0dd2da6..320abd6f 100644 --- a/tools/dbus-print-message.c +++ b/tools/dbus-print-message.c @@ -352,6 +352,13 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth) int fd; dbus_message_iter_get_basic (iter, &fd); printf ("unix fd %d\n", fd); + + /* dbus_message_iter_get_basic() duplicated the fd, we need to + * close it after use. The original fd will be closed when the + * DBusMessage is released. + */ + close (fd); + break; } |