]> git.imager.perl.org - imager.git/commitdiff
more nearest_color leaks
authorTony Cook <tony@develop-help.com>
Tue, 23 Feb 2016 11:00:46 +0000 (22:00 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 23 Feb 2016 11:00:46 +0000 (22:00 +1100)
Imager.xs

index ae2e86598bb5566f395cc56f8eb5ad809d4b3f99..b8bfde82db0c8861f93d68c10f12d879fe27e905 100644 (file)
--- 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<num; i++) {
          xo[i]   = (i_img_dim)SvIV(* av_fetch(axx, i, 0));
          yo[i]   = (i_img_dim)SvIV(* av_fetch(ayy, i, 0));