bootctl: Fix NULL pointer dereference

Fixes: #25952
This commit is contained in:
Jan Janssen 2023-01-06 09:26:04 +01:00 committed by Lennart Poettering
parent 4a6c6d35e4
commit 6e689dc6ee

View File

@ -723,9 +723,11 @@ static int boot_entry_load_unified(
if (!tmp.title)
return log_oom();
tmp.sort_key = strdup(good_sort_key);
if (!tmp.sort_key)
return log_oom();
if (good_sort_key) {
tmp.sort_key = strdup(good_sort_key);
if (!tmp.sort_key)
return log_oom();
}
if (good_version) {
tmp.version = strdup(good_version);