From: Ilia Alshanetsky Date: Wed, 12 Sep 2007 18:26:49 +0000 (+0000) Subject: Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). X-Git-Tag: php-5.2.5RC1~168 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=910850be511805f42cdf89725a14ffcaa13f7804;p=php Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). --- diff --git a/NEWS b/NEWS index 33a91eef20..213312d386 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Reported by Laurent gaffie. (Ilia) - Fixed imagerectangle regression with 1x1 rectangle (libgd #106). (Pierre) +- Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). (Ilia) - Fixed bug #42627 (bz2 extension fails to build with -fno-common). (dolecek at netbsd dot org) - Fixed Bug #42596 (session.save_path MODE option does not work). (Ilia) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 2c64411f32..ff65aeb7f8 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1453,12 +1453,6 @@ 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); } @@ -1478,6 +1472,12 @@ static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) dbh->methods->rollback(dbh TSRMLS_CC); 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);