fix two memory leaks involving get_tag()