fix memory leak in ch_table