r821: fixed memory when -y is used

This commit is contained in:
Heng Li 2018-07-31 15:14:37 -04:00
parent 99ecdf7b5d
commit b32296e18f
2 changed files with 2 additions and 1 deletions

2
main.c
View File

@ -10,7 +10,7 @@
#include "getopt.h" #include "getopt.h"
#endif #endif
#define MM_VERSION "2.11-r819-dirty" #define MM_VERSION "2.11-r821-dirty"
#ifdef __linux__ #ifdef __linux__
#include <sys/resource.h> #include <sys/resource.h>

1
map.c
View File

@ -601,6 +601,7 @@ static void *worker_pipeline(void *shared, int step, void *in)
free(s->reg[i]); free(s->reg[i]);
free(s->seq[i].seq); free(s->seq[i].name); free(s->seq[i].seq); free(s->seq[i].name);
if (s->seq[i].qual) free(s->seq[i].qual); if (s->seq[i].qual) free(s->seq[i].qual);
if (s->seq[i].comment) free(s->seq[i].comment);
} }
} }
free(s->reg); free(s->n_reg); free(s->seq); // seg_off, n_seg, rep_len and frag_gap were allocated with reg; no memory leak here free(s->reg); free(s->n_reg); free(s->seq); // seg_off, n_seg, rep_len and frag_gap were allocated with reg; no memory leak here