diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 545fd09e6b..6380c10cb4 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -526,9 +526,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(); + } tmp.version = strdup(good_version); if (!tmp.version)