summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/sd-bus.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2015-08-02 00:59:42 +0900
committerNamhyung Kim <namhyung@gmail.com>2015-08-02 23:12:08 +0900
commit253f96e53eb98dd811d380ffe108c53f48765ad2 (patch)
tree331ddd1c3bdb3b5c69edf21826561b859583a970 /src/libsystemd/sd-bus/sd-bus.c
parent0fd8d506f4c41cb5b43649adde154353198d1ea8 (diff)
sd-bus: use mfree() in bus_reset_queues()
Recently mfree() was introduced to reduce work of tedious free + reset pointers. Use it in bus_reset_queues() too.
Diffstat (limited to 'src/libsystemd/sd-bus/sd-bus.c')
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index b9e93f6f41..e700168659 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -84,15 +84,13 @@ static void bus_reset_queues(sd_bus *b) {
while (b->rqueue_size > 0)
sd_bus_message_unref(b->rqueue[--b->rqueue_size]);
- free(b->rqueue);
- b->rqueue = NULL;
+ b->rqueue = mfree(b->rqueue);
b->rqueue_allocated = 0;
while (b->wqueue_size > 0)
sd_bus_message_unref(b->wqueue[--b->wqueue_size]);
- free(b->wqueue);
- b->wqueue = NULL;
+ b->wqueue = mfree(b->wqueue);
b->wqueue_allocated = 0;
}