Skip to content

Commit aef9557

Browse files
committed
- Fixed memory leak on serialize(new SNMP)
1 parent be2bfd1 commit aef9557

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/snmp/snmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,9 +1988,9 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
19881988

19891989
while (zend_hash_get_current_data_ex(&php_snmp_properties, (void**)&hnd, &pos) == SUCCESS) {
19901990
zend_hash_get_current_key_ex(&php_snmp_properties, &key, &key_len, &num_key, 0, &pos);
1991-
MAKE_STD_ZVAL(val);
19921991
if (!hnd->read_func || hnd->read_func(obj, &val TSRMLS_CC) != SUCCESS) {
19931992
val = EG(uninitialized_zval_ptr);
1993+
Z_ADDREF_P(val);
19941994
}
19951995
zend_hash_update(props, key, key_len, (void *)&val, sizeof(zval *), NULL);
19961996
zend_hash_move_forward_ex(&php_snmp_properties, &pos);

0 commit comments

Comments
 (0)