diff options
author | Christoph M. Becker <cmb@php.net> | 2015-07-13 18:30:33 +0200 |
---|---|---|
committer | Christoph M. Becker <cmb@php.net> | 2015-07-13 18:30:33 +0200 |
commit | 1a4722a89ee85be74af5086a7027b3ad1e0a55e8 (patch) | |
tree | e2ad96291198ef997864a814f31b7051375a88b3 | |
parent | 25e5c8ac31df7021d7db3190a53403a55eb04e20 (diff) | |
download | php-git-1a4722a89ee85be74af5086a7027b3ad1e0a55e8.tar.gz |
Fix #70064: imagescale(..., IMG_BICUBIC) leaks memory
A temporary image (tmp_im) is created with gdImageTrueColor() and freed with
gdFree() instead of gdImageDestroy(). Let's fix that.
-rw-r--r-- | ext/gd/libgd/gd_interpolation.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index f9c8f88e70..32d69f9c20 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -1073,12 +1073,12 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt dst = gdImageCreateTrueColor(new_width, new_height); if (dst == NULL) { - gdFree(tmp_im); + gdImageDestroy(tmp_im); return NULL; } gdImageSetInterpolationMethod(dst, src->interpolation_id); _gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height); - gdFree(tmp_im); + gdImageDestroy(tmp_im); return dst; } |