]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: create/remove unit bus name slots always together
authorLennart Poettering <lennart@poettering.net>
Mon, 23 Dec 2019 15:48:18 +0000 (16:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 Jan 2020 14:21:44 +0000 (15:21 +0100)
commita5b07847950c603605acf85b472b210cd2da40fb
tree6ee3d50e422b8e9c620e94a5254bb670d9c5ddc8
parent5085ef0d711f1faaacddaf5519daeb150794ea99
core: create/remove unit bus name slots always together

When a service unit watches a bus name (i.e. because of BusName= being
set), then we do two things: we install a match slot to watch how its
ownership changes, and we inquire about the current owner. Make sure we
always do both together or neither.

This in particular fixes a corner-case memleak when destroying bus
connections, since we never freed the GetNameOwner() bus slots when
destroying a bus when they were still ongoing.
src/core/dbus.c
src/core/unit.c