From f8c280d85a3fc5b02e9b19f4e23ddac233abf1e4 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Mon, 5 Nov 2012 20:56:19 -0800 Subject: These need to be volatile in order to prevent leaking after the longjmp in the error handler --- ext/gd/libgd/gd_png.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c index 49f7cb0777..bdbb7ee7d3 100644 --- a/ext/gd/libgd/gd_png.c +++ b/ext/gd/libgd/gd_png.c @@ -127,8 +127,8 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; + volatile png_bytep image_data = NULL; + volatile png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; -- cgit v1.2.1 From 0ee5d18f91d731636f3ba39c7487e2a8cf04fa36 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Mon, 5 Nov 2012 21:06:18 -0800 Subject: News entry for png memleak fix --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 2e1f13bd5e..83274c20f2 100644 --- a/NEWS +++ b/NEWS @@ -1395,6 +1395,7 @@ PHP NEWS - GD extension: . Fixed bug #53492 (fix crash if anti-aliasing steps are invalid). (Pierre) + . Fixed potential memory leak on a png error (Rasmus, Paul Saab) - GMP extension: . Fixed bug #52906 (gmp_mod returns negative result when non-negative is -- cgit v1.2.1