summaryrefslogtreecommitdiffstats
path: root/src/firstboot
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-12-11 16:44:04 +0100
committerLennart Poettering <lennart@poettering.net>2020-12-15 18:00:02 +0100
commit79485fc27a5b18ac8957960eaccbc8a960e1bd64 (patch)
tree1229d7b0a5dd6d6638cf758bc3816c24c0c56736 /src/firstboot
parenthostname-setup: clarify that failures reading /etc/hostname are ignored (diff)
downloadsystemd-79485fc27a5b18ac8957960eaccbc8a960e1bd64.tar.xz
systemd-79485fc27a5b18ac8957960eaccbc8a960e1bd64.zip
firstboot: clean-up the copied hostname, not argv[] directly, as that's ugly
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index 48baae3f89..afead11b42 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -1139,11 +1139,11 @@ static int parse_argv(int argc, char *argv[]) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Host name %s is not valid.", optarg);
- hostname_cleanup(optarg);
r = free_and_strdup(&arg_hostname, optarg);
if (r < 0)
return log_oom();
+ hostname_cleanup(arg_hostname);
break;
case ARG_MACHINE_ID: