summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.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_api.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_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 644598225f..6b8891dd8b 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -588,6 +588,9 @@ void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRM
if (zend_hash_find(&EG(persistent_list), mysql->hash_key, strlen(mysql->hash_key) + 1, (void **)&le) == SUCCESS) {
if (Z_TYPE_P(le) == php_le_pmysqli()) {
mysqli_plist_entry *plist = (mysqli_plist_entry *) le->ptr;
+#if defined(MYSQLI_USE_MYSQLND)
+ mysqlnd_end_psession(mysql->mysql);
+#endif
zend_ptr_stack_push(&plist->free_links, mysql->mysql);
MyG(num_active_persistent)--;