From: Tony Cook Date: Tue, 23 Feb 2016 11:00:46 +0000 (+1100) Subject: more nearest_color leaks X-Git-Tag: v1.004_001~11 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/c799dac7ac86923d93f4e12f5eb72e42607848bb more nearest_color leaks --- diff --git a/Imager.xs b/Imager.xs index ae2e8659..b8bfde82 100644 --- a/Imager.xs +++ b/Imager.xs @@ -3047,9 +3047,9 @@ i_nearest_color(im, ...) num = num <= av_len(ac) ? num : av_len(ac); num++; if (num < 2) croak("Usage: i_nearest_color array refs must have more than 1 entry each"); - xo = mymalloc( sizeof(i_img_dim) * num ); - yo = mymalloc( sizeof(i_img_dim) * num ); - ival = mymalloc( sizeof(i_color) * num ); + xo = malloc_temp( sizeof(i_img_dim) * num ); + yo = malloc_temp( sizeof(i_img_dim) * num ); + ival = malloc_temp( sizeof(i_color) * num ); for(i = 0; i