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);
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,