From 422b040772b29e43d62fbd72ed5267a7df953b45 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 18 Dec 2017 21:58:14 +0100 Subject: 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. --- src/libelogind/sd-bus/bus-slot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libelogind/sd-bus/bus-slot.c b/src/libelogind/sd-bus/bus-slot.c index f7c9bfdf6..9a5637171 100644 --- a/src/libelogind/sd-bus/bus-slot.c +++ b/src/libelogind/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); -- cgit v1.2.3