]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hostname: use free_and_strdup_and_warn()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Jan 2021 07:46:18 +0000 (16:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Feb 2021 04:49:27 +0000 (13:49 +0900)
src/hostname/hostnamed.c

index 73949fbfb8949e373fe93e37e1a54cf596bfdc6a..840e65714124e7ee8f0e4a9de1f498d67b687941 100644 (file)
@@ -790,7 +790,7 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_
         if (r == 0)
                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
 
-        r = free_and_strdup(&c->data[PROP_STATIC_HOSTNAME], name);
+        r = free_and_strdup_warn(&c->data[PROP_STATIC_HOSTNAME], name);
         if (r < 0)
                 return r;
 
@@ -870,7 +870,7 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess
         if (r == 0)
                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
 
-        r = free_and_strdup(&c->data[prop], name);
+        r = free_and_strdup_warn(&c->data[prop], name);
         if (r < 0)
                 return r;