summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c6
-rw-r--r--src/libsystemd/sd-bus/bus-message.c3
-rw-r--r--src/libsystemd/sd-bus/busctl-introspect.c3
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c6
4 files changed, 6 insertions, 12 deletions
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index c3cc2b7212..99b9aa8084 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -107,8 +107,7 @@ _public_ sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c) {
free(c->cgroup_root);
free(c->description);
- free(c->supplementary_gids);
- c->supplementary_gids = NULL;
+ c->supplementary_gids = mfree(c->supplementary_gids);
strv_free(c->well_known_names);
c->well_known_names = NULL;
@@ -1016,8 +1015,7 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
return r;
} else {
if (c->cmdline_size == 0) {
- free(c->cmdline);
- c->cmdline = NULL;
+ c->cmdline = mfree(c->cmdline);
}
c->mask |= SD_BUS_CREDS_CMDLINE;
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 366a026426..72e2b9f785 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -113,8 +113,7 @@ static void message_reset_containers(sd_bus_message *m) {
free(m->containers[i].offsets);
}
- free(m->containers);
- m->containers = NULL;
+ m->containers = mfree(m->containers);
m->n_containers = m->containers_allocated = 0;
m->root_container.index = 0;
diff --git a/src/libsystemd/sd-bus/busctl-introspect.c b/src/libsystemd/sd-bus/busctl-introspect.c
index 03e83d08a1..abe482fc46 100644
--- a/src/libsystemd/sd-bus/busctl-introspect.c
+++ b/src/libsystemd/sd-bus/busctl-introspect.c
@@ -55,8 +55,7 @@ static void context_reset_member(Context *c) {
}
static void context_reset_interface(Context *c) {
- free(c->interface_name);
- c->interface_name = NULL;
+ c->interface_name = mfree(c->interface_name);
c->interface_flags = 0;
context_reset_member(c);
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 4a9181613a..2ac4b9be8e 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -820,8 +820,7 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid)
b->machine = machine;
machine = NULL;
} else {
- free(b->machine);
- b->machine = NULL;
+ b->machine = mfree(b->machine);
}
if (pid) {
@@ -880,8 +879,7 @@ static int parse_container_kernel_address(sd_bus *b, const char **p, char **guid
b->machine = machine;
machine = NULL;
} else {
- free(b->machine);
- b->machine = NULL;
+ b->machine = mfree(b->machine);
}
if (pid) {