cvs: php-src /ext/gd/libgd gd_topal.c
| From: | Ilia Alshanetsky | Date: | Wed, 11 Aug 2004 23:25:50 +0000 |
| Subject: | cvs: php-src /ext/gd/libgd gd_topal.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-28292@lists.php.net to get a copy of this message | ||
iliaa Wed Aug 11 19:25:50 2004 EDT
Modified files:
/php-src/ext/gd/libgd gd_topal.c
Log:
Fixed memory leak.
http://cvs.php.net/diff.php/php-src/ext/gd/libgd/gd_topal.c?r1=1.16&r2=1.17&ty=u
Index: php-src/ext/gd/libgd/gd_topal.c
diff -u php-src/ext/gd/libgd/gd_topal.c:1.16 php-src/ext/gd/libgd/gd_topal.c:1.17
--- php-src/ext/gd/libgd/gd_topal.c:1.16 Thu Jul 22 18:38:59 2004
+++ php-src/ext/gd/libgd/gd_topal.c Wed Aug 11 19:25:50 2004
@@ -1926,7 +1926,8 @@
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;