From: Heng Li Date: Fri, 24 Apr 2009 19:44:46 +0000 (+0000) Subject: * samtools-0.1.3-4 (r242) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0a5f488be0185854a13828f8fd87c7efb9d5f88e;p=samtools.git * samtools-0.1.3-4 (r242) * fixed a memory leak --- diff --git a/bam_md.c b/bam_md.c index a998f1b..303a83d 100644 --- a/bam_md.c +++ b/bam_md.c @@ -81,8 +81,11 @@ int bam_fillmd(int argc, char *argv[]) b = bam_init1(); while ((ret = bam_read1(fp, b)) >= 0) { - if (tid != b->core.tid) + if (tid != b->core.tid) { + free(ref); ref = fai_fetch(fai, header->target_name[b->core.tid], &len); + tid = b->core.tid; + } bam_fillmd1(b, ref, is_equal); bam_write1(fpout, b); } diff --git a/bamtk.c b/bamtk.c index a9daa52..b10c339 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.3-3" +#define PACKAGE_VERSION "0.1.3-4 (r242)" #endif int bam_taf2baf(int argc, char *argv[]);