imlib: Fix quad_segment_maxima memory leak.

Memory forgot to free when nmaxima is least 4 maxima.
This commit is contained in:
dianjixz 2022-03-30 16:21:49 +08:00 committed by GitHub
parent 63c4ce2dbb
commit 3bdae6d7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;