summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-08-11 23:25:50 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-08-11 23:25:50 +0000
commit61d60153b2b58c416adaa48ed38cff9feb669be2 (patch)
treedc500815e9ea7dba170a3cff04cc2ee236356242
parentbf8a6a07d87c3abe3507fccad9defb822184cd61 (diff)
downloadphp-git-61d60153b2b58c416adaa48ed38cff9feb669be2.tar.gz
Fixed memory leak.
-rw-r--r--ext/gd/libgd/gd_topal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/gd/libgd/gd_topal.c b/ext/gd/libgd/gd_topal.c
index cdd9055088..15eed3e11e 100644
--- a/ext/gd/libgd/gd_topal.c
+++ b/ext/gd/libgd/gd_topal.c
@@ -1926,7 +1926,8 @@ static void gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int color
init_error_limit (oim, nim, cquantize);
arraysize = (size_t) ((nim->sx + 2) * (3 * sizeof (FSERROR)));
/* Allocate Floyd-Steinberg workspace. */
- cquantize->fserrors = gdCalloc (arraysize, 1);
+ cquantize->fserrors = gdRealloc(cquantize->fserrors, arraysize);
+ memset(cquantize->fserrors, 0, arraysize);
if (!cquantize->fserrors)
{
goto outOfMemory;