Bug #16132: odbc connection closed twice
| From: | kolian at bigfoot dot com | Date: | Mon, 18 Mar 2002 05:58:20 +0000 |
| Subject: | Bug #16132: odbc connection closed twice | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-2728@lists.php.net to get a copy of this message | ||
From: kolian@bigfoot.com
Operating system: Win2k
PHP version: 4.1.2
PHP Bug Type: ODBC related
Bug description: odbc connection closed twice
The code in php_odbc.c, that checks if a persistent connections still
alive, when finds a bad connection will try to deallocate the connection
twice causing Access Violation in SQLServer ODBC driver
zend_hash_del will make a call to _close_odbc_connection
through destruction process.
safe_odbc_disconnect(db_conn->hdbc);
SQLFreeConnect(db_conn->hdbc);
Aren't nessessary here and will cause Access Violation in SQLServer
driver.
Line 2125 in php_odbc.c
if(ODBCG(check_persistent)){
RETCODE ret;
UCHAR d_name[32];
SWORD len;
ret = SQLGetInfo(db_conn->hdbc, SQL_DATA_SOURCE_READ_ONLY, d_name,
sizeof(d_name), &len);
if(ret != SQL_SUCCESS || len == 0) {
zend_hash_del(&EG(persistent_list), hashed_details, hashed_len + 1);
safe_odbc_disconnect(db_conn->hdbc);
SQLFreeConnect(db_conn->hdbc);
goto try_and_get_another_connection;
}
}
}
--
Edit bug report at http://bugs.php.net/?id=16132&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16132&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16132&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16132&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16132&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16132&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16132&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16132&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16132&r=submittedtwice