summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-09-30 18:10:03 +0000
committerAndrey Hristov <andrey@php.net>2010-09-30 18:10:03 +0000
commit77d73b814bc388e7dab0a68d371c03b7189f63b2 (patch)
treeb6933761ee0dd634ea96d346bc5d0e62cae93be8 /ext/mysqli/mysqli.c
parent53d3320951d731c15ae9adfecb4881e94c230e37 (diff)
downloadphp-git-77d73b814bc388e7dab0a68d371c03b7189f63b2.tar.gz
Plug a leak in mysqli when in the same script
a pconn is reused. Call end_psession earlier - so will mysqlnd and the plugins free data earlier.
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 9e6d7e4ffd..862854ab67 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -895,7 +895,8 @@ PHP_RSHUTDOWN_FUNCTION(mysqli)
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-#ifdef MYSQLI_USE_MYSQLND
+#ifdef A0 && MYSQLI_USE_MYSQLND
+ /* psession is being called when the connection is freed - explicitly or implicitly */
zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysqli_persistent_helper_once TSRMLS_CC);
#endif
return SUCCESS;