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; }