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: default avatarSimon McVittie <>
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);
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