root = NULL when releasing the memory

The root of the tree was assigned to NULL, after the memory release. The
parameter of the function was changed to reference to pointer...