Skip to content

Commit 5063b5a

Browse files
committed
Fix leak if throw_exception_object() fails
1 parent 5829458 commit 5063b5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Zend/zend_exceptions.c

+1
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */
10701070

10711071
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
10721072
zend_throw_error(NULL, "Cannot throw objects that do not implement Throwable");
1073+
zval_ptr_dtor(exception);
10731074
return;
10741075
}
10751076
zend_throw_exception_internal(exception);

0 commit comments

Comments
 (0)