changed list_destroy() to list_free().