From 0e265bc09ef0ba18d0b3f30f0450ed7dfc283830 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Sun, 21 Feb 2016 13:31:16 +1100 Subject: [PATCH] getcolorusage() leaked in i_get_anonymous_color_histo() on too many colors i_get_anonymous_color_histo() leaked the sample buffer. --- image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/image.c b/image.c index 6e1c58e0..cbd1b38a 100644 --- a/image.c +++ b/image.c @@ -1302,7 +1302,8 @@ i_get_anonymous_color_histo(i_img *im, unsigned int **col_usage, int maxc) { colorcnt += octt_add(ct, samp[x], samp[x+1], samp[x+2]); x += 3; if (colorcnt > maxc) { - octt_delete(ct); + octt_delete(ct); + myfree(samp); return -1; } } -- 2.39.5