mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fix memory source of string duplication for non internal properties
This commit is contained in:
parent
19ec7a09fc
commit
9603e44eb6
@ -1708,11 +1708,12 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
|
||||
|
||||
if (ce->type & ZEND_INTERNAL_CLASS) {
|
||||
property = malloc(sizeof(zval));
|
||||
ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
|
||||
} else {
|
||||
ALLOC_ZVAL(property);
|
||||
ZVAL_STRINGL(property, value, len, 1);
|
||||
}
|
||||
INIT_PZVAL(property);
|
||||
ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user