mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
Fixed memory leak with persistent connections
This commit is contained in:
parent
23a7a275ed
commit
194b309d2d
1 changed files with 7 additions and 1 deletions
|
@ -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) {
|
||||
|
@ -1399,6 +1401,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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue