--- a/thermferm/panel.c Wed Aug 13 22:02:14 2014 +0200 +++ b/thermferm/panel.c Thu Aug 14 21:50:38 2014 +0200 @@ -49,6 +49,7 @@ extern int my_shutdown; extern int debug; extern int setupmenu; +extern units_list *current_unit; int Key_Enter = FALSE; int Key_Enter_Long = FALSE; @@ -181,8 +182,12 @@ if (setupmenu != MENU_NONE) { if (menutimer < MENU_TIMEOUT) menutimer++; - else + else { setupmenu = MENU_NONE; + if (current_unit) + free(current_unit); + current_unit = NULL; + } } } }