Fix the same memory leak present in the 3ds version