mirror of
https://github.com/lh3/minimap2.git
synced 2026-10-05 21:08:12 +08:00
r1054: fixed a memory leak
This commit is contained in:
@@ -138,7 +138,10 @@ mm128_t *mg_lchain_dp(int max_dist_x, int max_dist_y, int bw, int max_skip, int
|
|||||||
uint64_t *u;
|
uint64_t *u;
|
||||||
|
|
||||||
if (_u) *_u = 0, *n_u_ = 0;
|
if (_u) *_u = 0, *n_u_ = 0;
|
||||||
if (n == 0 || a == 0) return 0;
|
if (n == 0 || a == 0) {
|
||||||
|
kfree(km, a);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (max_dist_x < bw) max_dist_x = bw;
|
if (max_dist_x < bw) max_dist_x = bw;
|
||||||
if (max_dist_y < bw && !is_cdna) max_dist_y = bw;
|
if (max_dist_y < bw && !is_cdna) max_dist_y = bw;
|
||||||
KMALLOC(km, p, n);
|
KMALLOC(km, p, n);
|
||||||
@@ -239,7 +242,10 @@ mm128_t *mg_lchain_rmq(int max_dist, int max_dist_inner, int bw, int max_chn_ski
|
|||||||
kmp_rmq_t *mp;
|
kmp_rmq_t *mp;
|
||||||
|
|
||||||
if (_u) *_u = 0, *n_u_ = 0;
|
if (_u) *_u = 0, *n_u_ = 0;
|
||||||
if (n == 0 || a == 0) return 0;
|
if (n == 0 || a == 0) {
|
||||||
|
kfree(km, a);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (max_dist < bw) max_dist = bw;
|
if (max_dist < bw) max_dist = bw;
|
||||||
if (max_dist_inner <= 0 || max_dist_inner >= max_dist) max_dist_inner = 0;
|
if (max_dist_inner <= 0 || max_dist_inner >= max_dist) max_dist_inner = 0;
|
||||||
KMALLOC(km, p, n);
|
KMALLOC(km, p, n);
|
||||||
|
|||||||
Reference in New Issue
Block a user