Fix a memory leak happened in table_test