diff options
Diffstat (limited to 'src/shared/bootspec.c')
-rw-r--r-- | src/shared/bootspec.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 17c28c6e01..354eb6828d 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -254,7 +254,6 @@ static int boot_entries_find( size_t *n_entries) { _cleanup_strv_free_ char **files = NULL; - size_t n_allocated = *n_entries; char **f; int r; @@ -268,7 +267,7 @@ static int boot_entries_find( return log_error_errno(r, "Failed to list files in \"%s\": %m", dir); STRV_FOREACH(f, files) { - if (!GREEDY_REALLOC0(*entries, n_allocated, *n_entries + 1)) + if (!GREEDY_REALLOC0(*entries, *n_entries + 1)) return log_oom(); r = boot_entry_load(root, *f, *entries + *n_entries); @@ -463,7 +462,6 @@ static int boot_entries_find_unified( size_t *n_entries) { _cleanup_(closedirp) DIR *d = NULL; - size_t n_allocated = *n_entries; struct dirent *de; int r; @@ -491,7 +489,7 @@ static int boot_entries_find_unified( if (!endswith_no_case(de->d_name, ".efi")) continue; - if (!GREEDY_REALLOC0(*entries, n_allocated, *n_entries + 1)) + if (!GREEDY_REALLOC0(*entries, *n_entries + 1)) return log_oom(); fd = openat(dirfd(d), de->d_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK); @@ -749,7 +747,6 @@ int boot_entries_augment_from_loader( "auto-reboot-to-firmware-setup", "Reboot Into Firmware Interface", }; - size_t n_allocated; char **i; assert(config); @@ -757,8 +754,6 @@ int boot_entries_augment_from_loader( /* Let's add the entries discovered by the boot loader to the end of our list, unless they are * already included there. */ - n_allocated = config->n_entries; - STRV_FOREACH(i, found_by_loader) { _cleanup_free_ char *c = NULL, *t = NULL, *p = NULL; char **a, **b; @@ -785,7 +780,7 @@ int boot_entries_augment_from_loader( if (!p) return log_oom(); - if (!GREEDY_REALLOC0(config->entries, n_allocated, config->n_entries + 1)) + if (!GREEDY_REALLOC0(config->entries, config->n_entries + 1)) return log_oom(); config->entries[config->n_entries++] = (BootEntry) { |