]> granicus.if.org Git - php/commitdiff
Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT).
authorIlia Alshanetsky <iliaa@php.net>
Wed, 12 Sep 2007 18:26:49 +0000 (18:26 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 12 Sep 2007 18:26:49 +0000 (18:26 +0000)
NEWS
ext/pdo/pdo_dbh.c

diff --git a/NEWS b/NEWS
index 33a91eef200b4496f71d599876b4ea80accdd60a..213312d38654f44b442df793b536948f0f8e3bf7 100644 (file)
--- 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)
index 2c64411f32fc1988061d00f891c6cf2f12774fb2..ff65aeb7f8b6f50be1621d13d30f404fcba7f2d6 100755 (executable)
@@ -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);