From 70caa957aa83c556f230629c3f24f5835f3a7a08 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Fri, 1 Mar 2013 13:22:10 -0600 Subject: [PATCH] [libpng12] Avoid a possible memory leak in contrib/gregbook/readpng.c --- ANNOUNCE | 5 +++-- CHANGES | 3 ++- contrib/gregbook/readpng.c | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 7e1b5b2f..2db57c7c 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.2.51beta02 - January 22, 2013 +Libpng 1.2.51beta02 - March 1, 2013 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -48,7 +48,8 @@ version 1.2.51beta01 [January 22, 2013] in configure.ac Changed default value of PNG_USER_CACHE_MAX from 0 to 32767 in pngconf.h. -version 1.2.51beta02 [January 22, 2013] +version 1.2.51beta02 [March 1, 2013] + Avoid a possible memory leak in contrib/gregbook/readpng.c (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/CHANGES b/CHANGES index 5086ebcd..f293eea0 100644 --- a/CHANGES +++ b/CHANGES @@ -2784,7 +2784,8 @@ version 1.2.51beta01 [January 22, 2013] in configure.ac Changed default value of PNG_USER_CACHE_MAX from 0 to 32767 in pngconf.h. -version 1.2.51beta02 [January 22, 2013] +version 1.2.51beta02 [March 1, 2013] + Avoid a possible memory leak in contrib/gregbook/readpng.c Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/gregbook/readpng.c b/contrib/gregbook/readpng.c index abfc1fb4..a3362aeb 100644 --- a/contrib/gregbook/readpng.c +++ b/contrib/gregbook/readpng.c @@ -214,6 +214,10 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes) * libpng function */ if (setjmp(png_jmpbuf(png_ptr))) { + free(image_data); + image_data = NULL; + free(row_pointers); + row_pointers = NULL; png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; }