]> granicus.if.org Git - php/commitdiff
Fixed a crash inside PDO when there is more then one instance of a
authorIlia Alshanetsky <iliaa@php.net>
Wed, 27 Jun 2007 02:02:18 +0000 (02:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 27 Jun 2007 02:02:18 +0000 (02:02 +0000)
persistent connection inside a script and PDO object is extended by class
with a destructor

ext/pdo/pdo_dbh.c

index af0db42771c7a2394c4f69037e86b9fc94bac069..70d1c13d52a90ab7511a27474eb1282a688b9aa6 100755 (executable)
@@ -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) {