summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2022-01-23 11:57:49 +0700
committerGitHub <noreply@github.com>2022-01-23 11:57:49 +0700
commit0956816bc63acadf6208cb1010807735ad6b0597 (patch)
treed4182ce254a70650ea506ebfca2997d4a92fab24 /src
parent3f872fc931f17244aec542c9e0d6eb1a61bddf05 (diff)
downloadlibgd-0956816bc63acadf6208cb1010807735ad6b0597.tar.gz
#797 possible leak on png error, returns from setjmp lost the row_poi… (#802)
* #797 possible leak on png error, returns from setjmp lost the row_pointers ref somehow * skip that one using mingw until we have a reliable portable FP related tests suites (may never happpen)
Diffstat (limited to 'src')
-rw-r--r--src/gd_png.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gd_png.c b/src/gd_png.c
index a325e5c..4d8d49f 100644
--- a/src/gd_png.c
+++ b/src/gd_png.c
@@ -1079,11 +1079,12 @@ static int _gdImagePngCtxEx(gdImagePtr im, gdIOCtx * outfile, int level)
}
png_write_image (png_ptr, row_pointers);
- png_write_end (png_ptr, info_ptr);
for (j = 0; j < height; ++j)
gdFree (row_pointers[j]);
gdFree (row_pointers);
+
+ png_write_end (png_ptr, info_ptr);
} else {
png_write_image (png_ptr, im->pixels);
png_write_end (png_ptr, info_ptr);