now also freeing the malloc blocks for branch names