diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-11-27 14:43:30 +0100 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-11-27 14:49:04 +0100 |
commit | 7d93fa7099cb1b408c0903fcd062acd2d1f7eba3 (patch) | |
tree | 8a3fe85b8f4f00f3f3f8bf8762c920b0b84dfd75 /src | |
parent | basic/fileio: minor coding style cleanup (diff) | |
download | systemd-7d93fa7099cb1b408c0903fcd062acd2d1f7eba3.tar.xz systemd-7d93fa7099cb1b408c0903fcd062acd2d1f7eba3.zip |
shared/bootspec: move boot_entry_addons_done() up, drop separate prototype
Follow-up for e2501a851e10f5279862b2bccbdd9184572cce6a
Diffstat (limited to '')
-rw-r--r-- | src/shared/bootspec.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 9c4877055a..db223d6694 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -58,7 +58,16 @@ static const char* const boot_entry_source_json_table[_BOOT_ENTRY_SOURCE_MAX] = DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source_json, BootEntrySource); -static void boot_entry_addons_done(BootEntryAddons *addons); +static void boot_entry_addons_done(BootEntryAddons *addons) { + assert(addons); + + FOREACH_ARRAY(addon, addons->items, addons->n_items) { + free(addon->cmdline); + free(addon->location); + } + addons->items = mfree(addons->items); + addons->n_items = 0; +} static void boot_entry_free(BootEntry *entry) { assert(entry); @@ -1076,17 +1085,6 @@ static int insert_boot_entry_addon( return 0; } -static void boot_entry_addons_done(BootEntryAddons *addons) { - assert(addons); - - FOREACH_ARRAY(addon, addons->items, addons->n_items) { - free(addon->cmdline); - free(addon->location); - } - addons->items = mfree(addons->items); - addons->n_items = 0; -} - static int boot_entries_find_unified_addons( BootConfig *config, int d_fd, |