fix memory leak in gui_get_chains_list