Add custom free() function to bs_tree.