mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 13:28:02 +02:00
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>
This commit is contained in:
parent
6864780bd6
commit
eb4584d5c5
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue