Why do you fill tens of trees? Do you delete the trees in the end? Can you run valgrind on your code and post the leak checker output?
Why do you fill tens of trees? Do you delete the trees in the end? Can you run valgrind on your code and post the leak checker output?