summaryrefslogtreecommitdiff
path: root/src/login/loginctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/loginctl.c')
-rw-r--r--src/login/loginctl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 9709eca9bd..5fa98e069f 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -372,11 +372,9 @@ static int prop_map_first_of_struct(sd_bus *bus, const char *member, sd_bus_mess
if (r < 0)
return r;
- free(*p);
- *p = strdup(s);
-
- if (!*p)
- return -ENOMEM;
+ r = free_and_strdup(p, s);
+ if (r < 0)
+ return r;
} else {
r = sd_bus_message_read_basic(m, contents[0], userdata);
if (r < 0)