From b66a4c157e9754528eec16c235265b4ce94d31e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 30 Jan 2025 15:25:38 +0100 Subject: [PATCH] firstboot: fix crash when hostname question is skipped --- src/firstboot/firstboot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 15abb53be8..bfd4bbe9fb 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; }