Skip to content

Commit d0a1708

Browse files
committed
Fix GH-14643 ext/standard: segfault on user shutdown function release.
1 parent e4250ce commit d0a1708

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/standard/basic_functions.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,9 +1582,12 @@ static void fci_release(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache)
15821582
void user_shutdown_function_dtor(zval *zv) /* {{{ */
15831583
{
15841584
php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
1585+
zend_fcall_info *fci = &shutdown_function_entry->fci;
15851586

1586-
zend_fcall_info_args_clear(&shutdown_function_entry->fci, true);
1587-
fci_release(&shutdown_function_entry->fci, &shutdown_function_entry->fci_cache);
1587+
if (fci) {
1588+
zend_fcall_info_args_clear(fci, true);
1589+
fci_release(fci, &shutdown_function_entry->fci_cache);
1590+
}
15881591
efree(shutdown_function_entry);
15891592
}
15901593
/* }}} */

0 commit comments

Comments
 (0)