mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
imlib: Fix quad_segment_maxima memory leak.
Memory forgot to free when nmaxima is least 4 maxima.
This commit is contained in:
parent
63c4ce2dbb
commit
3bdae6d7e2
@ -9628,8 +9628,12 @@ int quad_segment_maxima(apriltag_detector_t *td, zarray_t *cluster, struct line_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if we didn't get at least 4 maxima, we can't fit a quad.
|
// if we didn't get at least 4 maxima, we can't fit a quad.
|
||||||
if (nmaxima < 4)
|
if (nmaxima < 4){
|
||||||
return 0;
|
fb_free(); // maxima_errs
|
||||||
|
fb_free(); // maxima
|
||||||
|
fb_free(); // errs
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// select only the best maxima if we have too many
|
// select only the best maxima if we have too many
|
||||||
int max_nmaxima = td->qtp.max_nmaxima;
|
int max_nmaxima = td->qtp.max_nmaxima;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user