These pointers will leak. Not necessarily an issue, but worth adding a comment so that you don't blindly create create and throw away trees in a loop.