diff options
author | Pierre Joye <pierre.php@gmail.com> | 2015-01-07 06:32:19 +0100 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2015-01-07 06:32:19 +0100 |
commit | e8a1a4699a9ab505012b17e4d7cc9c4cb969b4eb (patch) | |
tree | 8ca7b721e797fe7d7ae8cf3ab32c2852bdca4c8c | |
parent | 5f7c099fc83c64f947d974426c648d46626665a6 (diff) | |
download | libgd-e8a1a4699a9ab505012b17e4d7cc9c4cb969b4eb.tar.gz |
free coeffs
-rw-r--r-- | src/gd_filter.c | 12 |
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; |