]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: introduce _cleanup_strv_free_ 36071/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 Jan 2025 19:18:04 +0000 (04:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 Jan 2025 19:18:04 +0000 (04:18 +0900)
src/boot/boot.c
src/boot/cpio.c
src/boot/stub.c
src/boot/util.h

index f785a6daf41be1e9356d3bd2c3b28bca14168ec0..275126123467583a5f9805cbc38791b10c2eaa34 100644 (file)
@@ -683,7 +683,7 @@ static bool menu_run(
         bool new_mode = true, clear = true;
         bool refresh = true, highlight = false;
         size_t x_start = 0, y_start = 0, y_status = 0, x_max, y_max;
-        _cleanup_(strv_freep) char16_t **lines = NULL;
+        _cleanup_strv_free_ char16_t **lines = NULL;
         _cleanup_free_ char16_t *clearline = NULL, *separator = NULL, *status = NULL;
         uint64_t timeout_efivar_saved = config->timeout_sec_efivar;
         uint32_t timeout_remain = config->timeout_sec == TIMEOUT_MENU_FORCE ? 0 : config->timeout_sec;
index 6cbecc53aa25b6477267c30127a08f20499b60d5..fc5e303d7e6e58a747c7c32f0b6fe40a9b0e9255 100644 (file)
@@ -318,7 +318,7 @@ EFI_STATUS pack_cpio(
         size_t dirent_size = 0, buffer_size = 0, n_items = 0, n_allocated = 0;
         _cleanup_free_ char16_t *rel_dropin_dir = NULL;
         _cleanup_free_ EFI_FILE_INFO *dirent = NULL;
-        _cleanup_(strv_freep) char16_t **items = NULL;
+        _cleanup_strv_free_ char16_t **items = NULL;
         _cleanup_free_ void *buffer = NULL;
         uint32_t inode = 1; /* inode counter, so that each item gets a new inode */
         EFI_STATUS err;
index e1ccb34a0b8fd47d689b50f627a65b9258bdc360..e74b7db95adf0dc07ab4abf7a6ddb9e8a61055a3 100644 (file)
@@ -547,7 +547,7 @@ static EFI_STATUS load_addons(
                 NamedAddon **ucode_addons,                  /* Ditto */
                 size_t *n_ucode_addons) {
 
-        _cleanup_(strv_freep) char16_t **items = NULL;
+        _cleanup_strv_free_ char16_t **items = NULL;
         _cleanup_file_close_ EFI_FILE *root = NULL;
         size_t n_items = 0, n_allocated = 0;
         EFI_STATUS err;
index 17af86d41c6cc9e2444e3ff9c8996626c3728e61..49ba11961379b2fb7ae7cb4cde9402044b97bfc4 100644 (file)
@@ -169,6 +169,8 @@ static inline void strv_freep(char16_t ***p) {
         strv_free(*p);
 }
 
+#define _cleanup_strv_free_ _cleanup_(strv_freep)
+
 EFI_STATUS open_directory(EFI_FILE *root_dir, const char16_t *path, EFI_FILE **ret);
 
 /* Conversion between EFI_PHYSICAL_ADDRESS and pointers is not obvious. The former is always 64-bit, even on