diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-18 21:58:14 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-05 13:58:32 +0100 |
commit | 45754e01eaf0d473ea5b5413c0473d39dc5552eb (patch) | |
tree | ba4a2dfeb58315861e8ea3e63822d1e0700d6b93 /src/libsystemd | |
parent | sd-bus: add new API sd_bus_match_signal() + sd_bus_match_signal_asnyc() (diff) | |
download | systemd-45754e01eaf0d473ea5b5413c0473d39dc5552eb.tar.xz systemd-45754e01eaf0d473ea5b5413c0473d39dc5552eb.zip |
sd-bus: when disconnecting a slot, also reset its memory
Yes, we aren#t accessing this anymore after, but it's still nicer if
this is actually guaranteed.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/bus-slot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-slot.c b/src/libsystemd/sd-bus/bus-slot.c index f7c9bfdf65..9a56371715 100644 --- a/src/libsystemd/sd-bus/bus-slot.c +++ b/src/libsystemd/sd-bus/bus-slot.c @@ -104,7 +104,7 @@ void bus_slot_disconnect(sd_bus_slot *slot) { slot->bus->match_callbacks_modified = true; bus_match_remove(&slot->bus->match_callbacks, &slot->match_callback); - free(slot->match_callback.match_string); + slot->match_callback.match_string = mfree(slot->match_callback.match_string); break; @@ -179,7 +179,7 @@ void bus_slot_disconnect(sd_bus_slot *slot) { } } - free(slot->node_vtable.interface); + slot->node_vtable.interface = mfree(slot->node_vtable.interface); if (slot->node_vtable.node) { LIST_REMOVE(vtables, slot->node_vtable.node->vtables, &slot->node_vtable); |