mirror of
https://github.com/php/php-src.git
synced 2024-12-04 15:23:44 +08:00
Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code)
This commit is contained in:
parent
91fc0d1a41
commit
3780b027dd
@ -1767,7 +1767,7 @@ PHP_METHOD(Phar, buildFromDirectory)
|
||||
|
||||
if (SUCCESS != object_init_ex(®exiter, spl_ce_RegexIterator)) {
|
||||
zval_ptr_dtor(&iteriter);
|
||||
zval_dtor(®exiter);
|
||||
zval_ptr_dtor(®exiter);
|
||||
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@ -2218,7 +2218,7 @@ its_ok:
|
||||
|
||||
ZVAL_NULL(&ret);
|
||||
if (SUCCESS != object_init_ex(&ret, ce)) {
|
||||
zval_dtor(&ret);
|
||||
zval_ptr_dtor(&ret);
|
||||
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -4127,7 +4127,7 @@ ZEND_METHOD(reflection_class, getMethod)
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
method and not the closure definition itself */
|
||||
reflection_method_factory(ce, mptr, NULL, return_value);
|
||||
zval_dtor(&obj_tmp);
|
||||
zval_ptr_dtor(&obj_tmp);
|
||||
efree(lc_name);
|
||||
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lc_name, name_len)) != NULL) {
|
||||
reflection_method_factory(ce, mptr, NULL, return_value);
|
||||
@ -4571,7 +4571,7 @@ ZEND_METHOD(reflection_class, isCloneable)
|
||||
return;
|
||||
}
|
||||
RETVAL_BOOL(Z_OBJ_HANDLER(obj, clone_obj) != NULL);
|
||||
zval_dtor(&obj);
|
||||
zval_ptr_dtor(&obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user