Issue Details (XML | Word | Printable)

Key: CORE-1868
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

AV in isc_dsql_free_statement()

Created: 25/Apr/08 05:28 AM   Updated: 18/Nov/08 12:46 PM
Component/s: API / Client Library
Affects Version/s: 2.1.0
Fix Version/s: 2.5 Alpha 1, 2.1.1

Time Tracking:
Not Specified

Environment: OS-independent

Planning Status: Unspecified


 Description  « Hide
When releasing statement with isc_dsql_free_statement(), AV happens in client library

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 25/Apr/08 06:10 AM
It seems IBO copies handle value into new variable after isc_dsql_alloc_statement2() and later deleted original variable which was used to initially obtain handle value.

Taking into an account, that "isc_dsql_allocate_statement2()
function is similar to the isc_dsql_alloc_statement() function except that
statement handles allocated using isc_dsql_allocate_statement2() are
automatically reset to NULL when the database under which they are allocated
is detached" (taken from ib6.0 beta docs), this is close to violation of API rules. On the other hand, nothing is said about isc_dsql_free_statement(), and if IBO itself releases all statements before detach, it works correctly. (Though there is no use in isc_dsql_allocate_statement2() instead of isc_dsql_allocate_statement() in that case.)

Legacy behavior of isc_dsql_free_statement() is restored.