Only the last header was being saved. Now saves them all and explicitly frees the duped strings.
Only the last header was being saved. Now saves them all and explicitly frees the duped strings.