php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16132 odbc connection closed twice
Submitted: 2002-03-18 00:58 UTC Modified: 2002-04-26 10:58 UTC
From: kolian at bigfoot dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.1.2 OS: Win2k
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kolian at bigfoot dot com
New email:
PHP Version: OS:

 

 [2002-03-18 00:58 UTC] kolian at bigfoot dot com
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;
}
}
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-26 10:58 UTC] kalowsky@php.net
This bug has been fixed in CVS.

Thanks for your report.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Mar 26 04:00:02 2026 UTC