]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.3-4 (r242)
authorHeng Li <lh3@live.co.uk>
Fri, 24 Apr 2009 19:44:46 +0000 (19:44 +0000)
committerHeng Li <lh3@live.co.uk>
Fri, 24 Apr 2009 19:44:46 +0000 (19:44 +0000)
 * fixed a memory leak

bam_md.c
bamtk.c

index a998f1b1d2ae9119b69b9252bce4d608830b0cc2..303a83df85b1849b6319f3647bbb35fb0488eb59 100644 (file)
--- 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 a9daa528edea33617cc8b0dc20a58049e0b7bc83..b10c339ee4aae419ce894d8184b787a3b00d6a7b 100644 (file)
--- 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[]);