From: Ilia Alshanetsky Date: Wed, 11 Aug 2004 23:25:54 +0000 (+0000) Subject: MFH: Fixed memory leak. X-Git-Tag: php-4.3.9RC2~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c38946f8387e690a08f816f5047ecac6c6fbdca1;p=php MFH: Fixed memory leak. --- 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;