summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2007-06-17 19:03:58 +0000
committerNuno Lopes <nlopess@php.net>2007-06-17 19:03:58 +0000
commit74474a1ef89efcf841868c5e0fba6322dad1646b (patch)
tree04372d07e6783741af2e30fb1b78c62705615cdd
parentfcd0a1e790c25b357be50d3105b3ef20a3a1a5cd (diff)
downloadphp-git-74474a1ef89efcf841868c5e0fba6322dad1646b.tar.gz
malloc+memset == calloc (sync with libgd)
-rw-r--r--ext/gd/libgd/gd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 9119a00b08..301072f4e7 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -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);