fix memory leak in tranpose of slice by reference