Fix crash when toggling menu switch when we're in 'Core Updater' screen

This commit is contained in:
twinaphex 2015-04-15 09:55:23 +02:00
parent 5b6030c2c7
commit ee3442b962

View File

@ -1563,6 +1563,9 @@ int cb_core_updater_list(void *data_, size_t len)
if (!data)
return -1;
if (core_buf)
free(core_buf);
core_buf = (char*)malloc(len * sizeof(char));
if (!core_buf)
@ -1584,9 +1587,6 @@ static int deferred_push_core_updater_list(void *data, void *userdata,
print_buf_lines(list, core_buf, core_len, MENU_FILE_DOWNLOAD_CORE);
if (core_buf)
free(core_buf);
menu_list_populate_generic(list, path, label, type);
return 0;