]> git.donarmstrong.com Git - samtools.git/commitdiff
fixed a memory leak in bam_fetch()
authorHeng Li <lh3@live.co.uk>
Wed, 1 Dec 2010 04:52:50 +0000 (04:52 +0000)
committerHeng Li <lh3@live.co.uk>
Wed, 1 Dec 2010 04:52:50 +0000 (04:52 +0000)
bam_index.c

index f60a6f874b106f03c655d1207dddf21c4df7fc48..0638a2e826a1ceb10f86a144ca42c78355bcae35 100644 (file)
@@ -698,6 +698,7 @@ int bam_fetch(bamFile fp, const bam_index_t *idx, int tid, int beg, int end, voi
        b = bam_init1();
        iter = bam_iter_query(idx, tid, beg, end);
        while ((ret = bam_iter_read(fp, iter, b)) >= 0) func(b, data);
+       bam_iter_destroy(iter);
        bam_destroy1(b);
        return (ret == -1)? 0 : ret;
 }