nlopess Mon Sep 3 14:34:42 2007 UTC Modified files: /php-src/ext/gd/libgd gd.c Log: MFB: malloc+memset == calloc # this was sitting here for quite a looong time.. http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.111&r2=1.112&diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.111 php-src/ext/gd/libgd/gd.c:1.112 --- php-src/ext/gd/libgd/gd.c:1.111 Sun Aug 26 20:33:21 2007 +++ php-src/ext/gd/libgd/gd.c Mon Sep 3 14:34:42 2007 @@ -129,8 +129,8 @@ return NULL; } - im = (gdImage *) gdMalloc(sizeof(gdImage)); - memset(im, 0, sizeof(gdImage)); + im = (gdImage *) gdCalloc(1, sizeof(gdImage)); + /* Row-major ever since gd 1.3 */ im->pixels = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); im->AA_opacity = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php