From abffe87d42a884f0fdb621f541d1447884bca619 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 27 Jun 2007 02:02:18 +0000 Subject: [PATCH] Fixed a crash inside PDO when there is more then one instance of a persistent connection inside a script and PDO object is extended by class with a destructor --- ext/pdo/pdo_dbh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index af0db42771..70d1c13d52 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1423,6 +1423,12 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) } } + if (dbh->properties) { + zend_hash_destroy(dbh->properties); + efree(dbh->properties); + dbh->properties = NULL; + } + pefree(dbh, dbh->is_persistent); } @@ -1443,12 +1449,6 @@ static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) dbh->in_txn = 0; } - if (dbh->properties) { - zend_hash_destroy(dbh->properties); - efree(dbh->properties); - dbh->properties = NULL; - } - if (!dbh->is_persistent) { dbh_free(dbh TSRMLS_CC); } else if (dbh->methods && dbh->methods->persistent_shutdown) { -- 2.40.0