com php-src: Fix memory leak in imagescale(): NEWS ext/gd/libgd /gd_interpolation.c
| From: | Stanislav Malyshev | Date: | Tue, 24 May 2016 23:12:01 +0000 |
| Subject: | com php-src: Fix memory leak in imagescale(): NEWS ext/gd/libgd /gd_interpolation.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92189@lists.php.net to get a copy of this message | ||
Commit: 9a826a3bd99315b7c4d4673acd3084c99eb04253
Author: Stanislav Malyshev <stas@php.net> Tue, 24 May 2016 16:12:01 -0700
Parents: f423e1bb895d64c50dc538e8cdc556324e8b8cc2
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9a826a3bd99315b7c4d4673acd3084c99eb04253
Log:
Fix memory leak in imagescale()
Changed paths:
M NEWS
M ext/gd/libgd/gd_interpolation.c
Diff:
diff --git a/NEWS b/NEWS
index f824cea..afc6fa7 100644
--- a/NEWS
+++ b/NEWS
@@ -10,7 +10,7 @@ PHP NEWS
. Fixed bug #72135 (Integer Overflow in php_html_entities). (Stas)
- GD:
- . Fixed bug ##72227 (imagescale out-of-bounds read). (Stas)
+ . Fixed bug #72227 (imagescale out-of-bounds read). (Stas)
- Intl:
. Fixed bug #72241 (get_icu_value_internal out-of-bounds read). (Stas)
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index a017498..0961c08 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -1070,12 +1070,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;
}
@@ -1093,7 +1093,7 @@ gdImagePtr Scale(const gdImagePtr src, const unsigned int src_width, const
unsig
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
- gdFree(tmp_im);
+ gdImageDestroy(tmp_im);
return dst;
}