Skip to content

[1.12] bus: Don't explicitly clear BusConnections.monitors

Simon McVittie requested to merge cherry-pick-b034b83b into dbus-1.12

Each connection that is an active monitor holds a pointer to its own link in this list, via BusConnectionData.link_in_monitors. We can't validly free the list while these pointers exist: that would be a use-after-free, when each connection gets disconnected and tries to remove itself from the list.

Instead, let each connection remove itself from the list, then assert that the list has become empty.

Signed-off-by: Simon McVittie smcv@collabora.com Resolves: #291 (closed)

(cherry picked from commit b034b83b)

Merge request reports