summaryrefslogtreecommitdiff
path: root/ext/pdo
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-08-07 17:33:20 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-08-07 17:33:20 +0000
commit434704eaf04234184b9dd9971aa1cc7c8884dc0b (patch)
tree01a93ad9027fbd9ba18cb8c9465b2937ae0a44eb /ext/pdo
parent36be62c0e18f8bc64ee84daf28c3080b5b0dbbb7 (diff)
downloadphp-git-434704eaf04234184b9dd9971aa1cc7c8884dc0b.tar.gz
MFB: Fixed memory leak with persistent connections
Diffstat (limited to 'ext/pdo')
-rwxr-xr-xext/pdo/pdo_dbh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 9c8bb059ce..b0b1c2fd6c 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -342,7 +342,9 @@ static PHP_METHOD(PDO, dbh_constructor)
/* 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 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
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);
}