diff options
author | Antony Dovgal <tony2001@php.net> | 2005-10-03 23:27:26 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-10-03 23:27:26 +0000 |
commit | ffe605f2ed32b63c1f57657deb64fc0b6960265e (patch) | |
tree | fe9b23fb5d1b645ba208ec257cc9c7dfac4c6eb3 | |
parent | 1c667a88e72d00b44c68b5c47952c71492b3d6c3 (diff) | |
download | php-git-ffe605f2ed32b63c1f57657deb64fc0b6960265e.tar.gz |
free cls_methods correctly and fix segfault on shutdown
(no bug entry and MFB, though..)
-rwxr-xr-x | ext/pdo/pdo_dbh.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 7752973010..7843f94dea 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1337,6 +1337,8 @@ void pdo_dbh_init(TSRMLS_D) static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) { + int i; + if (--dbh->refcount) return; @@ -1357,8 +1359,11 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) if (dbh->def_stmt_ctor_args) { zval_ptr_dtor(&dbh->def_stmt_ctor_args); } - if (dbh->cls_methods) { - zend_hash_destroy(&dbh->cls_methods); + + 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, dbh->is_persistent); |