Skip to content

Commit 35b7937

Browse files
committed
dtor callable on failure
1 parent 6902734 commit 35b7937

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/session/session.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ PHP_FUNCTION(session_set_save_handler)
20582058

20592059
/* add shutdown function, removing the old one if it exists */
20602060
if (!register_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1, &shutdown_function_entry)) {
2061-
//zval_ptr_dtor(&shutdown_function_entry.function_name);
2061+
zval_ptr_dtor(&callable);
20622062
php_error_docref(NULL, E_WARNING, "Unable to register session shutdown function");
20632063
RETURN_FALSE;
20642064
}
@@ -2677,8 +2677,7 @@ PHP_FUNCTION(session_register_shutdown)
26772677
ZEND_ASSERT(result == SUCCESS);
26782678

26792679
if (!append_user_shutdown_function(&shutdown_function_entry)) {
2680-
zval_ptr_dtor(&shutdown_function_entry.fci.function_name);
2681-
//efree(shutdown_function_entry);
2680+
zval_ptr_dtor(&callable);
26822681

26832682
/* Unable to register shutdown function, presumably because of lack
26842683
* of memory, so flush the session now. It would be done in rshutdown

0 commit comments

Comments
 (0)