Skip to content

Commit 3780b02

Browse files
committed
Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code)
1 parent 91fc0d1 commit 3780b02

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/phar/phar_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,7 @@ PHP_METHOD(Phar, buildFromDirectory)
17671767

17681768
if (SUCCESS != object_init_ex(&regexiter, spl_ce_RegexIterator)) {
17691769
zval_ptr_dtor(&iteriter);
1770-
zval_dtor(&regexiter);
1770+
zval_ptr_dtor(&regexiter);
17711771
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
17721772
RETURN_FALSE;
17731773
}
@@ -2218,7 +2218,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /*
22182218

22192219
ZVAL_NULL(&ret);
22202220
if (SUCCESS != object_init_ex(&ret, ce)) {
2221-
zval_dtor(&ret);
2221+
zval_ptr_dtor(&ret);
22222222
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
22232223
return NULL;
22242224
}

ext/reflection/php_reflection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4127,7 +4127,7 @@ ZEND_METHOD(reflection_class, getMethod)
41274127
/* don't assign closure_object since we only reflect the invoke handler
41284128
method and not the closure definition itself */
41294129
reflection_method_factory(ce, mptr, NULL, return_value);
4130-
zval_dtor(&obj_tmp);
4130+
zval_ptr_dtor(&obj_tmp);
41314131
efree(lc_name);
41324132
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lc_name, name_len)) != NULL) {
41334133
reflection_method_factory(ce, mptr, NULL, return_value);
@@ -4571,7 +4571,7 @@ ZEND_METHOD(reflection_class, isCloneable)
45714571
return;
45724572
}
45734573
RETVAL_BOOL(Z_OBJ_HANDLER(obj, clone_obj) != NULL);
4574-
zval_dtor(&obj);
4574+
zval_ptr_dtor(&obj);
45754575
}
45764576
}
45774577
}

0 commit comments

Comments
 (0)