From 4a861abc1fbad6883ae21747016d822d205068e6 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 (cherry picked from commit b66a4c157e9754528eec16c235265b4ce94d31e8) --- 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 9be62b8df3..a389eeae10 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; }