Only NULL PG and RG structures if this is not bam_hdr_t out & add missing regfree