diff options
author | Adrian Vovk <adrianvovk@gmail.com> | 2024-10-30 20:38:49 +0100 |
---|---|---|
committer | Adrian Vovk <adrianvovk@gmail.com> | 2024-11-26 22:33:11 +0100 |
commit | ef370a3c30ca4b0a4ccf0c94867640355ba5ff52 (patch) | |
tree | b6a5d5c8edb75f0417d96b91e27537f498d07ee7 /src | |
parent | bootspec: Fixup memory leak (diff) | |
download | systemd-ef370a3c30ca4b0a4ccf0c94867640355ba5ff52.tar.xz systemd-ef370a3c30ca4b0a4ccf0c94867640355ba5ff52.zip |
bootspec: Fixup loading of local addons for UKIs
Follow-up for 59b3df9
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/bootspec.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 49440dded1..6672c69f57 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -1215,16 +1215,18 @@ static int boot_entries_find_unified( if (r < 0) continue; - if (!GREEDY_REALLOC0(config->entries, config->n_entries + 2)) + if (!GREEDY_REALLOC0(config->entries, config->n_entries + 1)) return log_oom(); - if (boot_entry_load_unified(root, j, p, osrelease, profile, cmdline, config->entries + config->n_entries) < 0) - continue; + BootEntry *entry = config->entries + config->n_entries; - config->n_entries++; + if (boot_entry_load_unified(root, j, p, osrelease, profile, cmdline, entry) < 0) + continue; /* look for .efi.extra.d */ - (void) boot_entries_find_unified_local_addons(config, dirfd(d), de->d_name, full, config->entries + config->n_entries); + (void) boot_entries_find_unified_local_addons(config, dirfd(d), de->d_name, full, entry); + + config->n_entries++; } } |