mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
malloc+memset == calloc (sync with libgd)
This commit is contained in:
parent
fcd0a1e790
commit
74474a1ef8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user