Skip to content

Commit

Permalink
Fix memory error on shutdown (PHP-8.1) (#4325)
Browse files Browse the repository at this point in the history
Ref of function_name was held by zend_fcall_info_init().
  • Loading branch information
twose authored Jul 19, 2021
1 parent db6deb0 commit 70b2664
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion ext-src/php_swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ void php_swoole_register_shutdown_function(const char *function) {
zend_fcall_info_init(
&function_name, 0, &shutdown_function_entry.fci, &shutdown_function_entry.fci_cache, NULL, NULL);
register_user_shutdown_function(Z_STRVAL(function_name), Z_STRLEN(function_name), &shutdown_function_entry);
zval_ptr_dtor(&function_name);
#else
zval *function_name;
#if PHP_VERSION_ID >= 80000
Expand Down

0 comments on commit 70b2664

Please sign in to comment.