Refactor content_history_free_entry
This commit is contained in:
parent
7ce4f68bcc
commit
0c39c2ef3f
|
@ -242,9 +242,7 @@ void *menu_init(const void *data)
|
||||||
if (!menu_ctx)
|
if (!menu_ctx)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
menu = (menu_handle_t*)menu_ctx->init();
|
if (!(menu = (menu_handle_t*)menu_ctx->init()))
|
||||||
|
|
||||||
if (!menu)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
strlcpy(g_settings.menu.driver, menu_ctx->ident, sizeof(g_settings.menu.driver));
|
strlcpy(g_settings.menu.driver, menu_ctx->ident, sizeof(g_settings.menu.driver));
|
||||||
|
|
13
history.c
13
history.c
|
@ -57,9 +57,16 @@ void content_history_get_index(content_history_t *hist,
|
||||||
|
|
||||||
static void content_history_free_entry(struct content_history_entry *entry)
|
static void content_history_free_entry(struct content_history_entry *entry)
|
||||||
{
|
{
|
||||||
free(entry->path);
|
if (entry->path)
|
||||||
free(entry->core_path);
|
free(entry->path);
|
||||||
free(entry->core_name);
|
entry->path = NULL;
|
||||||
|
if (entry->core_path)
|
||||||
|
free(entry->core_path);
|
||||||
|
entry->core_path = NULL;
|
||||||
|
if (entry->core_name)
|
||||||
|
free(entry->core_name);
|
||||||
|
entry->core_name = NULL;
|
||||||
|
|
||||||
memset(entry, 0, sizeof(*entry));
|
memset(entry, 0, sizeof(*entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue