From baf6b67658a58c4b5c3480aa82fe71a2c2ccfbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 13 Jul 2021 21:05:00 +0200 Subject: [PATCH] Fix #35: List with updae filename was freed before it was used. This is now fixed and working --- stm-firmware/ui/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stm-firmware/ui/gui.c b/stm-firmware/ui/gui.c index 809300c..f9f9ba2 100644 --- a/stm-firmware/ui/gui.c +++ b/stm-firmware/ui/gui.c @@ -673,10 +673,10 @@ static void gui_update_firmware(struct lcd_menu *menu, enum menu_entry_func_entr if (button == BUTTON_SHORT_RELEASED) { fname = sl_list_nth(file_list, currently_selected_file)->data; menu_display_clear(menu); - sl_list_free_full(file_list, delete_file_list_entry); file_list = NULL; - updater_update_from_file(fname); + /* This code is here for completeness. It will never be reached! */ + sl_list_free_full(file_list, delete_file_list_entry); } else if (button == BUTTON_LONG) { sl_list_free_full(file_list, delete_file_list_entry); file_list = NULL;