Fix memory leak in import.