From: Zbigniew Jędrzejewski-Szmek Date: Thu, 30 Jan 2025 14:25:38 +0000 (+0100) Subject: firstboot: fix crash when hostname question is skipped X-Git-Tag: v258-rc1~1447 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b66a4c157e9754528eec16c235265b4ce94d31e8;p=thirdparty%2Fsystemd.git firstboot: fix crash when hostname question is skipped --- diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 15abb53be84..bfd4bbe9fb2 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -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; }