iliaa Mon Aug 7 17:33:21 2006 UTC
Modified files:
/php-src/ext/pdo pdo_dbh.c
Log:
MFB: Fixed memory leak with persistent connections
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.133&r2=1.134&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.133 php-src/ext/pdo/pdo_dbh.c:1.134
--- php-src/ext/pdo/pdo_dbh.c:1.133 Tue Aug 1 16:37:11 2006
+++ php-src/ext/pdo/pdo_dbh.c Mon Aug 7 17:33:20 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dbh.c,v 1.133 2006/08/01 16:37:11 iliaa Exp $ */
+/* $Id: pdo_dbh.c,v 1.134 2006/08/07 17:33:20 iliaa Exp $ */
/* The PDO Database Handle Class */
@@ -342,7 +342,9 @@
/* switch over to the persistent one */
dbh = pdbh;
zend_object_store_set_object(object, dbh TSRMLS_CC);
- dbh->refcount++;
+ if (!call_factory) {
+ dbh->refcount++;
+ }
}
if (hashkey) {
@@ -1378,6 +1380,10 @@
pefree(dbh->password, dbh->is_persistent);
}
+ if (dbh->persistent_id) {
+ pefree((char *)dbh->persistent_id, dbh->is_persistent);
+ }
+
if (dbh->def_stmt_ctor_args) {
zval_ptr_dtor(&dbh->def_stmt_ctor_args);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php