summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2015-01-07 06:32:19 +0100
committerPierre Joye <pierre.php@gmail.com>2015-01-07 06:32:19 +0100
commite8a1a4699a9ab505012b17e4d7cc9c4cb969b4eb (patch)
tree8ca7b721e797fe7d7ae8cf3ab32c2852bdca4c8c
parent5f7c099fc83c64f947d974426c648d46626665a6 (diff)
downloadlibgd-e8a1a4699a9ab505012b17e4d7cc9c4cb969b4eb.tar.gz
free coeffs
-rw-r--r--src/gd_filter.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gd_filter.c b/src/gd_filter.c
index 577e974..10bd06e 100644
--- a/src/gd_filter.c
+++ b/src/gd_filter.c
@@ -824,11 +824,15 @@ gdImageCopyGaussianBlurred(gdImagePtr src, int radius, double sigma)
int tcstat;
src = gdImageClone(src);
- if (!src) return NULL;
+ if (!src) {
+ gdFree(coeffs);
+ return NULL;
+ }
tcstat = gdImagePaletteToTrueColor(src);
if (!tcstat) {
gdImageDestroy(src);
+ gdFree(coeffs);
return NULL;
}/* if */
@@ -837,7 +841,10 @@ gdImageCopyGaussianBlurred(gdImagePtr src, int radius, double sigma)
/* Apply the filter horizontally. */
tmp = gdImageCreateTrueColor(src->sx, src->sy);
- if (!tmp) return NULL;
+ if (!tmp) {
+ gdFree(coeffs);
+ return NULL;
+ }
applyCoeffs(src, tmp, coeffs, radius, HORIZONTAL);
/* Apply the filter vertically. */
@@ -847,6 +854,7 @@ gdImageCopyGaussianBlurred(gdImagePtr src, int radius, double sigma)
}/* if */
gdImageDestroy(tmp);
+ gdFree(coeffs);
if (freeSrc) gdImageDestroy(src);
return result;