1diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c 2index 5fef7ed14..5c8ff30f6 100644 3--- a/contrib/pngminus/png2pnm.c 4+++ b/contrib/pngminus/png2pnm.c 5@@ -208,6 +208,16 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, 6 if (setjmp (png_jmpbuf (png_ptr))) 7 { 8 png_destroy_read_struct (&png_ptr, &info_ptr, NULL); 9+ if(row_pointers != NULL) 10+ { 11+ free(row_pointers); 12+ row_pointers = NULL; 13+ } 14+ if(png_pixels != NULL) 15+ { 16+ free(png_pixels); 17+ png_pixels = NULL; 18+ } 19 return FALSE; 20 } 21 22