Initialise current_menu to NULL in menu(u16). Otherwise, choose_menu(&main_menu) tries to call the end_function of a menu that's a random pointer.