cvs: php4 /ext/odbc php_odbc.c
| From: | Dan Kalowsky | Date: | Tue, 13 Aug 2002 23:48:05 +0000 |
| Subject: | cvs: php4 /ext/odbc php_odbc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13334@lists.php.net to get a copy of this message | ||
kalowsky Tue Aug 13 19:48:05 2002 EDT
Modified files:
/php4/ext/odbc php_odbc.c
Log:
Fix for Bug #17572
Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.138 php4/ext/odbc/php_odbc.c:1.139
--- php4/ext/odbc/php_odbc.c:1.138 Tue Aug 13 17:39:36 2002
+++ php4/ext/odbc/php_odbc.c Tue Aug 13 19:48:05 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.c,v 1.138 2002/08/13 21:39:36 kalowsky Exp $ */
+/* $Id: php_odbc.c,v 1.139 2002/08/13 23:48:05 kalowsky Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -211,8 +211,23 @@
*/
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_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);