summaryrefslogtreecommitdiff
path: root/src/hostname/hostnamed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hostname/hostnamed.c')
-rw-r--r--src/hostname/hostnamed.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index e90ae54156..e1ce2e6b31 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -64,8 +64,7 @@ static void context_reset(Context *c) {
assert(c);
for (p = 0; p < _PROP_MAX; p++) {
- free(c->data[p]);
- c->data[p] = NULL;
+ c->data[p] = mfree(c->data[p]);
}
}
@@ -498,8 +497,7 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
if (isempty(name)) {
- free(c->data[PROP_STATIC_HOSTNAME]);
- c->data[PROP_STATIC_HOSTNAME] = NULL;
+ c->data[PROP_STATIC_HOSTNAME] = mfree(c->data[PROP_STATIC_HOSTNAME]);
} else {
char *h;
@@ -570,8 +568,7 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
if (isempty(name)) {
- free(c->data[prop]);
- c->data[prop] = NULL;
+ c->data[prop] = mfree(c->data[prop]);
} else {
char *h;