From: Dan Kalowsky Date: Tue, 13 Aug 2002 23:48:05 +0000 (+0000) Subject: Fix for Bug #17572 X-Git-Tag: php-4.3.0dev_zend2_alpha3~81 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f1b6397bcdd4cce1c17ecaaa3ff4f0fe3bcafc0;p=php Fix for Bug #17572 --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index be52ab4b64..e10f8dad38 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -211,8 +211,23 @@ static void safe_odbc_disconnect( void *handle ) */ static void _close_odbc_conn(zend_rsrc_list_entry *rsrc TSRMLS_DC) { + int i, nument, type; + void *ptr; + odbc_result *res; + odbc_connection *conn = (odbc_connection *)rsrc->ptr; + nument = zend_hash_next_free_element(&EG(regular_list)); + for(i = 1; i < nument; i++) { + ptr = zend_list_find(i, &type); + if (ptr && (type == le_result)) { + res = (odbc_result *)ptr; + if (res->conn_ptr == conn) { + zend_list_delete(i); + } + } + } + safe_odbc_disconnect(conn->hdbc); SQLFreeConnect(conn->hdbc); SQLFreeEnv(conn->henv); @@ -225,7 +240,21 @@ static void _close_odbc_conn(zend_rsrc_list_entry *rsrc TSRMLS_DC) */ static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc TSRMLS_DC) { + int i, nument, type; + void *ptr; + odbc_result *res; odbc_connection *conn = (odbc_connection *)rsrc->ptr; + + nument = zend_hash_next_free_element(&EG(regular_list)); + for(i = 1; i < nument; i++) { + ptr = zend_list_find(i, &type); + if (ptr && (type == le_result)) { + res = (odbc_result *)ptr; + if (res->conn_ptr == conn) { + zend_list_delete(i); + } + } + } safe_odbc_disconnect(conn->hdbc); SQLFreeConnect(conn->hdbc);