Skip to content

Commit

Permalink
Merge pull request #228 from wix-incubator/master
Browse files Browse the repository at this point in the history
Fix potential leak in find_trim(...)
  • Loading branch information
tonimelisma authored Dec 9, 2021
2 parents 56a7f51 + adf14dd commit d6f5c39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vips/arithmetic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d6f5c39

Please sign in to comment.