summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-02-16 16:59:17 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-02-16 16:59:17 +0100
commit708973c9bd4a34482d3d6b2921d4b9b1339bddf0 (patch)
treea6867f5a59ef3ef8deb7e41ef21a06cf7c79b082
parent3b91ed112ff06d6b38a6db9e28649f2b79b40cad (diff)
downloadphp-git-708973c9bd4a34482d3d6b2921d4b9b1339bddf0.tar.gz
Fix autoload_func_info destruction
Can't reference the function ptr after the closure has been destroyed.
-rw-r--r--ext/spl/php_spl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index aab10e568a..b8e10a563c 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -378,14 +378,14 @@ static void autoload_func_info_dtor(zval *element)
if (!Z_ISUNDEF(alfi->obj)) {
zval_ptr_dtor(&alfi->obj);
}
- if (!Z_ISUNDEF(alfi->closure)) {
- zval_ptr_dtor(&alfi->closure);
- }
if (alfi->func_ptr &&
UNEXPECTED(alfi->func_ptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
zend_string_release(alfi->func_ptr->common.function_name);
zend_free_trampoline(alfi->func_ptr);
}
+ if (!Z_ISUNDEF(alfi->closure)) {
+ zval_ptr_dtor(&alfi->closure);
+ }
efree(alfi);
}