]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: fix use of uninitialized value on error
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Mar 2025 17:00:25 +0000 (02:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Mar 2025 17:40:12 +0000 (02:40 +0900)
Follow-up for 0bdf94e588c8d781a91e5738525d673c0966a510.

src/boot/boot.c

index af7ab4e79371f9b0f67359b86c9979a55a6a3955..400e5ab5207d2c9ff4112a99701bab45e558d094 100644 (file)
@@ -1083,8 +1083,8 @@ static void config_defaults_load_from_file(Config *config, char *content) {
                                 bool reboot_yes_no;
                                 if (!parse_boolean(value, &reboot_yes_no))
                                         log_error("Error parsing 'reboot-on-error' config option, ignoring: %s", value);
-
-                                config->reboot_on_error = reboot_yes_no ? REBOOT_YES : REBOOT_NO;
+                                else
+                                        config->reboot_on_error = reboot_yes_no ? REBOOT_YES : REBOOT_NO;
                         }
 
                 } else if (streq8(key, "secure-boot-enroll")) {