Resolve memory leak

When the robot tried to go to unvisited cell and on the path the maze change so appear un visited cell, then there was a leak. Now should be ok