]> 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)
committerMike Yuan <me@yhndnzj.com>
Thu, 30 Jan 2025 18:48:43 +0000 (19:48 +0100)
src/firstboot/firstboot.c

index 15abb53be8454181d3c70e701ed900a9b637ed2f..bfd4bbe9fb2efd667e393f2627f29d370e1dc459 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;
 }