Fix mem free and in_list call