mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-21 19:38:12 +08:00
r506: fixed a memory leak
This commit is contained in:
@@ -211,6 +211,7 @@ void mm_select_sub(void *km, float pri_ratio, int min_diff, int best_n, int *n_,
|
||||
} else if ((r[i].score >= r[p].score * pri_ratio || r[i].score + min_diff >= r[p].score) && n_2nd < best_n) {
|
||||
if (!(r[i].qs == r[p].qs && r[i].qe == r[p].qe && r[i].rs == r[p].rs && r[i].re == r[p].re)) // not identical hits
|
||||
r[k++] = r[i], ++n_2nd;
|
||||
else if (r[i].p) free(r[i].p);
|
||||
} else if (r[i].p) free(r[i].p);
|
||||
}
|
||||
if (k != n) mm_sync_regs(km, k, r); // removing hits requires sync()
|
||||
|
||||
Reference in New Issue
Block a user