Commit eb4584d5 authored by Alban Crequy's avatar Alban Crequy Committed by Simon McVittie

dbus-monitor: do not leak file descriptors from fd-passing

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80603Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
parent 6864780b
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment