Skip to content

Commit

Permalink
fix core dump after seg vcf write
Browse files Browse the repository at this point in the history
  • Loading branch information
graphenn committed Dec 9, 2023
1 parent f6d9fde commit cf0b54e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cyvcf2/cyvcf2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ cdef class Writer(VCF):
if not self.header_written:
self.write_header()
if var.b.errcode == BCF_ERR_CTG_UNDEF:
h = bcf_hdr_id2hrec(self.ohdr, BCF_DT_CTG, 0, var.b.rid)
h = bcf_hdr_id2hrec(bcf_hdr_dup(self.ohdr), BCF_DT_CTG, 0, var.b.rid)
if h == NULL:
raise Exception("contig %d unknown and not found in header" % var.b.rid)
if bcf_hdr_add_hrec(self.hdr, h) < 0:
Expand Down

0 comments on commit cf0b54e

Please sign in to comment.