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
commit60327d87a7599ce5288a9fb7675f20f3ec29c7ff (patch)
tree645dd352c9ac5c2f6dce41feac3b7c11182c839e /ext/mysqli/mysqli.c
parent5c6f0ebeabd5ee4d8bd79f158fd7ee968ac28c0d (diff)
downloadphp-git-60327d87a7599ce5288a9fb7675f20f3ec29c7ff.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 0325e89ce5..b45622920d 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -893,7 +893,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;