Perhaps you should do this instead?

Simpler implementation of Climb.

This doesn't fix anything, but it eliminates the need to malloc and free in Climb.