Fix memory leak in uni::init_final_perm