From: Heng Li Date: Wed, 15 Apr 2009 12:18:19 +0000 (+0000) Subject: * samtools-0.1.2-27 X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=commitdiff_plain;h=6d35460bc21ebb0d46704c75301b41a4ed1643d1 * samtools-0.1.2-27 * fixed a small memory leak in tview --- diff --git a/bam_lpileup.c b/bam_lpileup.c index 3680287..21b4772 100644 --- a/bam_lpileup.c +++ b/bam_lpileup.c @@ -167,11 +167,17 @@ bam_lplbuf_t *bam_lplbuf_init(bam_pileup_f func, void *data) void bam_lplbuf_destroy(bam_lplbuf_t *tv) { - mp_free(tv->mp, tv->head); - mp_destroy(tv->mp); + freenode_t *p, *q; free(tv->cur_level); free(tv->pre_level); bam_plbuf_destroy(tv->plbuf); free(tv->aux); + for (p = tv->head; p->next;) { + q = p->next; + mp_free(tv->mp, p); p = q; + } + mp_free(tv->mp, p); + assert(tv->mp->cnt == 0); + mp_destroy(tv->mp); free(tv); } diff --git a/bamtk.c b/bamtk.c index e0bccb7..1c8c7b1 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.2-26" +#define PACKAGE_VERSION "0.1.2-27" #endif int bam_taf2baf(int argc, char *argv[]);