]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
efi/boot: use DEFINE_TRIVIAL_CLEANUP_FUNC() in one more place
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 6 Oct 2023 16:11:03 +0000 (18:11 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 12 Oct 2023 10:13:56 +0000 (12:13 +0200)
No functional change.

src/boot/efi/boot.c

index de801ceb37d2d0eaa72e1b3613d44b80b8e8f6de..f04971ebd607864cc6b595f4f4af22c1445f2753 100644 (file)
@@ -1117,9 +1117,9 @@ static void config_add_entry(Config *config, ConfigEntry *entry) {
         config->entries[config->n_entries++] = entry;
 }
 
-static void config_entry_free(ConfigEntry *entry) {
+static ConfigEntry* config_entry_free(ConfigEntry *entry) {
         if (!entry)
-                return;
+                return NULL;
 
         free(entry->id);
         free(entry->title_show);
@@ -1134,13 +1134,12 @@ static void config_entry_free(ConfigEntry *entry) {
         free(entry->path);
         free(entry->current_name);
         free(entry->next_name);
-        free(entry);
-}
 
-static void config_entry_freep(ConfigEntry **entry) {
-        config_entry_free(*entry);
+        return mfree(entry);
 }
 
+DEFINE_TRIVIAL_CLEANUP_FUNC(ConfigEntry *, config_entry_free);
+
 static char *line_get_key_value(
                 char *content,
                 const char *sep,