1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00

MFB: malloc+memset == calloc

# this was sitting here for quite a looong time..
This commit is contained in:
Nuno Lopes
2007-09-03 14:34:42 +00:00
parent 14df6eb975
commit 0006462a5b
+2 -2
View File
@@ -129,8 +129,8 @@ gdImagePtr gdImageCreate (int sx, int sy)
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);