com php-src: Fix #70064: imagescale(..., IMG_BICUBIC) lea ks memory: ext/gd/libgd/gd_interpolation.c

From: Date: Mon, 13 Jul 2015 16:30:33 +0000
Subject: com php-src: Fix #70064: imagescale(..., IMG_BICUBIC) lea ks memory: ext/gd/libgd/gd_interpolation.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87961@lists.php.net to get a copy of this message
Commit: 1a4722a89ee85be74af5086a7027b3ad1e0a55e8 Author: Christoph M. Becker <cmb@php.net> Mon, 13 Jul 2015 18:30:33 +0200 Parents: 25e5c8ac31df7021d7db3190a53403a55eb04e20 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1a4722a89ee85be74af5086a7027b3ad1e0a55e8 Log: 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. Bugs: https://bugs.php.net/70064 Changed paths: M ext/gd/libgd/gd_interpolation.c Diff: diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index f9c8f88...32d69f9 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; }

« previous php.cvs (#87961) next »