gcc complains for infinite recursion while freeing binary tree I am trying to write a generic free function for a binary tree.