From d9709119fa8fbd994645c1bc19c809405559bb51 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 21 Jan 2015 13:17:39 +0000 Subject: [PATCH] oop, leak in vips_resize() see https://github.com/jcupitt/libvips/issues/217 --- libvips/resample/resize.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libvips/resample/resize.c b/libvips/resample/resize.c index 84f3f2ff..ac3c6060 100644 --- a/libvips/resample/resize.c +++ b/libvips/resample/resize.c @@ -90,15 +90,16 @@ vips_resize_build( VipsObject *object ) return( -1 ); if( !vips_object_argument_isset( object, "interpolate" ) ) { + VipsInterpolate *interpolate; char *nick; if( vips_type_find( "VipsInterpolate", "bicubic" ) ) nick = "bicubic"; else nick = "bilinear"; - g_object_set( object, - "interpolate", vips_interpolate_new( nick ), - NULL ); + interpolate = vips_interpolate_new( nick ); + g_object_set( object, "interpolate", interpolate, NULL ); + VIPS_UNREF( interpolate ); } in = resample->in; @@ -280,7 +281,7 @@ vips_resize_init( VipsResize *resize ) * then resampled with vips_affine() and the supplied interpolator, then * sharpened. * - * @interpolate defaults to bucubic, or bilinear if that is not available. + * @interpolate defaults to bicubic, or bilinear if that is not available. * * @idx, @idy default to zero. Offset them by 0.5 to get pixel-centre sampling. *