]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firstboot: fix crash when hostname question is skipped
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Jan 2025 14:25:38 +0000 (15:25 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 8 Feb 2025 06:51:06 +0000 (15:51 +0900)
(cherry picked from commit b66a4c157e9754528eec16c235265b4ce94d31e8)

src/firstboot/firstboot.c

index 9be62b8df3d7aa66ce9325759c1020844c96dad1..a389eeae10ed057c76353e90688894cd636b2a3b 100644 (file)
@@ -634,7 +634,9 @@ static int prompt_hostname(int rfd) {
         if (r < 0)
                 return r;
 
-        hostname_cleanup(arg_hostname);
+        if (arg_hostname)
+                hostname_cleanup(arg_hostname);
+
         return 0;
 }