summaryrefslogtreecommitdiff
path: root/ext/session/mod_user.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-08-15 00:15:34 +0800
committerXinchen Hui <laruence@php.net>2012-08-15 00:15:34 +0800
commitda3660a4c42cb90c8d5626ac1da71c1201f98d4b (patch)
tree06b9282253399e55dff615e2a390a725ccc748bf /ext/session/mod_user.c
parent49e91151c0ac1e39caab14c2d323dc70acb723c0 (diff)
downloadphp-git-da3660a4c42cb90c8d5626ac1da71c1201f98d4b.tar.gz
Fixed bug (segfault due to PS(mod_user_implemented) not be reseted when closing handler call exit)
Diffstat (limited to 'ext/session/mod_user.c')
-rw-r--r--ext/session/mod_user.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index 2ff5302f78..41a63fc4b2 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -99,6 +99,7 @@ PS_OPEN_FUNC(user)
PS_CLOSE_FUNC(user)
{
+ zend_bool bailout = 0;
STDVARS;
if (!PS(mod_user_implemented)) {
@@ -106,9 +107,22 @@ PS_CLOSE_FUNC(user)
return SUCCESS;
}
- retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC);
+ zend_try {
+ retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC);
+ } zend_catch {
+ bailout = 1;
+ PS(mod_user_implemented) = 0;
+ } zend_end_try();
+
PS(mod_user_implemented) = 0;
+ if (bailout) {
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+ zend_bailout();
+ }
+
FINISH;
}