From adf14dd3a02294f101985ad39993f35705ee0b55 Mon Sep 17 00:00:00 2001 From: Elad Laufer Date: Mon, 6 Dec 2021 11:39:47 +0200 Subject: [PATCH] Fix potential leak in find_trim(...) (#1) --- vips/arithmetic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vips/arithmetic.c b/vips/arithmetic.c index cca894ac..10967ea8 100644 --- a/vips/arithmetic.c +++ b/vips/arithmetic.c @@ -38,8 +38,10 @@ int find_trim(VipsImage *in, int *left, int *top, int *width, int *height, } double background[3] = {r, g, b}; - VipsArrayDouble *vipsBackground = vips_array_double_new(background, 3); - return vips_find_trim(in, left, top, width, height, "threshold", threshold, "background", vipsBackground, NULL); + int code = vips_find_trim(in, left, top, width, height, "threshold", threshold, "background", vipsBackground, NULL); + + vips_area_unref(VIPS_AREA(vipsBackground)); + return code; }