]> git.donarmstrong.com Git - samtools.git/blobdiff - bam.c
* samtools-0.1.5-7 (r403)
[samtools.git] / bam.c
diff --git a/bam.c b/bam.c
index 22e09cf15c97a9035557926a1eda4c8e07792586..1ff4a5aba25028f4fccdd0735a9dcae594b6e9a8 100644 (file)
--- a/bam.c
+++ b/bam.c
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <ctype.h>
+#include <assert.h>
 #include "bam.h"
 #include "bam_endian.h"
 #include "kstring.h"
@@ -79,6 +80,7 @@ void bam_header_destroy(bam_header_t *header)
        }
        free(header->text);
 #ifndef BAM_NO_HASH
+       if (header->rg2lib) bam_strmap_destroy(header->rg2lib);
        bam_destroy_header_hash(header);
 #endif
        free(header);
@@ -284,4 +286,5 @@ void bam_view1(const bam_header_t *header, const bam1_t *b)
 {
        char *s = bam_format1(header, b);
        printf("%s\n", s);
+       free(s);
 }