summaryrefslogtreecommitdiff
path: root/ext/mysql
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-09-30 18:10:03 (GMT)
committerAndrey Hristov <andrey@php.net>2010-09-30 18:10:03 (GMT)
commit77d73b814bc388e7dab0a68d371c03b7189f63b2 (patch)
treeb6933761ee0dd634ea96d346bc5d0e62cae93be8 /ext/mysql
parent53d3320951d731c15ae9adfecb4881e94c230e37 (diff)
downloadphp-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/mysql')
-rw-r--r--ext/mysql/php_mysql.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index bd0a6e7..9ab1b78 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -637,7 +637,7 @@ PHP_RSHUTDOWN_FUNCTION(mysql)
efree(MySG(connect_error));
}
-#ifdef MYSQL_USE_MYSQLND
+#ifdef A0 && MYSQL_USE_MYSQLND
zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysql_persistent_helper TSRMLS_CC);
#endif
@@ -888,7 +888,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
mysql->multi_query = 0;
#endif
/* ensure that the link did not die */
-#if defined(MYSQL_USE_MYSQLND)
+#if A0 && defined(MYSQL_USE_MYSQLND)
mysqlnd_end_psession(mysql->conn);
#endif
if (mysql_ping(mysql->conn)) {