mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-26 06:28:11 +08:00
r129: fixed memory leak caused by qualities
This commit is contained in:
@@ -32,7 +32,7 @@ void bseq_close(bseq_file_t *fp)
|
||||
free(fp);
|
||||
}
|
||||
|
||||
bseq1_t *bseq_read(bseq_file_t *fp, int chunk_size, int *n_)
|
||||
bseq1_t *bseq_read(bseq_file_t *fp, int chunk_size, int with_qual, int *n_)
|
||||
{
|
||||
int size = 0, m, n;
|
||||
bseq1_t *seqs;
|
||||
@@ -48,7 +48,7 @@ bseq1_t *bseq_read(bseq_file_t *fp, int chunk_size, int *n_)
|
||||
s = &seqs[n];
|
||||
s->name = strdup(ks->name.s);
|
||||
s->seq = strdup(ks->seq.s);
|
||||
s->qual = ks->qual.l? strdup(ks->qual.s) : 0;
|
||||
s->qual = with_qual && ks->qual.l? strdup(ks->qual.s) : 0;
|
||||
s->l_seq = ks->seq.l;
|
||||
size += seqs[n++].l_seq;
|
||||
if (size >= chunk_size) break;
|
||||
|
||||
Reference in New Issue
Block a user