X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=pysam.git;a=blobdiff_plain;f=samtools%2Fsam.c;fp=samtools%2Fsam.c;h=ecdee02dddb98a32d47a59e3154179356acecadf;hp=ad4325bb4b8e8436d21e921478ed00467aac0e6b;hb=70e0c1963e5f83b0a6ab2aa139e1a8f30aa25c56;hpb=91f4887d1b19c44d68a2b19f0abee56de3dbb8ea diff --git a/samtools/sam.c b/samtools/sam.c index ad4325b..ecdee02 100644 --- a/samtools/sam.c +++ b/samtools/sam.c @@ -55,6 +55,7 @@ samfile_t *samopen(const char *fn, const char *mode, const void *aux) if (aux) { // check if aux is present bam_header_t *textheader = fp->header; fp->header = sam_header_read2((const char*)aux); + if (fp->header == 0) goto open_err_ret; append_header_text(fp->header, textheader->text, textheader->l_text); bam_header_destroy(textheader); }