systemd/0192-firstboot-fix-crash-when-hostname-question-is-skippe.patch
Jan Macku e0b00a8ea2 systemd-257-7
Resolves: RHEL-71409
2025-02-10 08:20:10 +01:00

26 lines
830 B
Diff

From 4a861abc1fbad6883ae21747016d822d205068e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
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;
}