[libpng16] Avoid a possible memory leak in contrib/gregbook/readpng.c

This commit is contained in:
Glenn Randers-Pehrson
2013-03-01 13:27:05 -06:00
parent e444514a94
commit 1118d6d985
3 changed files with 11 additions and 5 deletions

View File

@@ -215,6 +215,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;
}