Skip to content

Commit

Permalink
fixed segmentation fault due to unallocated memory (reflist) being fr…
Browse files Browse the repository at this point in the history
…eed at the end of extracthairs.c
  • Loading branch information
vibansal committed May 5, 2019
1 parent d04e51b commit 22d3451
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hairs-src/extracthairs.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,12 @@ int main(int argc, char** argv) {
free(reflist->names[i]);
if (reflist->used[i] ==1) free(reflist->sequences[i]);
}
free(reflist->names); free(reflist->sequences); free(reflist->lengths); free(reflist->used);
if (reflist->ns > 0) {
free(reflist->names);
free(reflist->sequences);
free(reflist->lengths);
free(reflist->used);
}
//free(reflist->offsets);
for (i=0;i<variants;i++){
free(varlist[i].genotype); free(varlist[i].RA); free(varlist[i].AA);free(varlist[i].chrom);
Expand Down

0 comments on commit 22d3451

Please sign in to comment.