diff options
| author | Nuno Lopes <nlopess@php.net> | 2007-09-03 14:34:42 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2007-09-03 14:34:42 +0000 |
| commit | 0006462a5bc29a7641f7d334133aaeab16adaba7 (patch) | |
| tree | e1ac0037295b6ad56e12843bb4b570c40d9e2cb9 | |
| parent | 14df6eb97541666697622ffe115667edc2213496 (diff) | |
| download | php-git-0006462a5bc29a7641f7d334133aaeab16adaba7.tar.gz | |
MFB: malloc+memset == calloc
# this was sitting here for quite a looong time..
| -rw-r--r-- | ext/gd/libgd/gd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 0a26b89370..35ce6edbdd 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); |
