iter = ecalloc(1, sizeof(*iter));
iter->zi.funcs = &php_pqres_iterator_funcs;
iter->zi.data = object;
- Z_ADDREF_P(object);
+ /* do not addref, because the iterator lives inside this object anyway */
zfetch_type = prop = zend_read_property(ce, object, ZEND_STRL("fetchType"), 0 TSRMLS_CC);
if (Z_TYPE_P(zfetch_type) != IS_LONG) {
zval_ptr_dtor(&iter->current_val);
iter->current_val = NULL;
}
- zval_ptr_dtor((zval **) &iter->zi.data);
efree(iter);
}