Skip to content

Commit fd019ea

Browse files
committed
ext/gd create gd object with zend_object_alloc
1 parent 05a1557 commit fd019ea

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ext/gd/gd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ PHP_GD_API gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp)
167167

168168
zend_object *php_gd_image_object_create(zend_class_entry *class_type)
169169
{
170-
size_t block_len = sizeof(php_gd_image_object) + zend_object_properties_size(class_type);
171-
php_gd_image_object *intern = emalloc(block_len);
172-
memset(intern, 0, block_len);
170+
php_gd_image_object *intern = zend_object_alloc(sizeof(php_gd_image_object), class_type);
173171

174172
zend_object_std_init(&intern->std, class_type);
175173
object_properties_init(&intern->std, class_type);

0 commit comments

Comments
 (0)