dmitry Fri Dec 23 09:41:31 2005 EDT Modified files: /php-src/ext/pdo pdo_dbh.c Log: Fixed memory corruption and termination through _zend_bailout() http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.106&r2=1.107&diff_format=u Index: php-src/ext/pdo/pdo_dbh.c diff -u php-src/ext/pdo/pdo_dbh.c:1.106 php-src/ext/pdo/pdo_dbh.c:1.107 --- php-src/ext/pdo/pdo_dbh.c:1.106 Tue Dec 6 02:24:41 2005 +++ php-src/ext/pdo/pdo_dbh.c Fri Dec 23 09:41:31 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_dbh.c,v 1.106 2005/12/06 02:24:41 sniper Exp $ */ +/* $Id: pdo_dbh.c,v 1.107 2005/12/23 09:41:31 dmitry Exp $ */ /* The PDO Database Handle Class */ @@ -1313,6 +1313,8 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) { + int i; + if (--dbh->refcount) return; @@ -1333,6 +1335,13 @@ if (dbh->def_stmt_ctor_args) { zval_ptr_dtor(&dbh->def_stmt_ctor_args); } + + for (i = 0; i < PDO_DBH_DRIVER_METHOD_KIND__MAX; i++) { + if (dbh->cls_methods[i]) { + zend_hash_destroy(dbh->cls_methods[i]); + pefree(dbh->cls_methods[i], dbh->is_persistent); + } + } pefree(dbh, dbh->is_persistent); } @@ -1349,9 +1358,6 @@ efree(dbh->properties); dbh->properties = NULL; } - if (dbh->cls_methods) { - zend_hash_destroy(&dbh->cls_methods); - } if (!dbh->is_persistent) { dbh_free(dbh TSRMLS_CC);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php