mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-19 18:47:54 +08:00
Merge pull request #34 from nyalldawson/read_after_free
Fix read after free error
This commit is contained in:
@@ -1149,6 +1149,8 @@ SQLRETURN SQL_API SQLFreeStmt(
|
|||||||
struct _hdbc *dbc = (struct _hdbc *) stmt->hdbc;
|
struct _hdbc *dbc = (struct _hdbc *) stmt->hdbc;
|
||||||
|
|
||||||
TRACE("SQLFreeStmt");
|
TRACE("SQLFreeStmt");
|
||||||
|
free(stmt->ole_str);
|
||||||
|
stmt->ole_str = NULL;
|
||||||
if (fOption==SQL_DROP) {
|
if (fOption==SQL_DROP) {
|
||||||
if (!g_ptr_array_remove(dbc->statements, stmt))
|
if (!g_ptr_array_remove(dbc->statements, stmt))
|
||||||
return SQL_INVALID_HANDLE;
|
return SQL_INVALID_HANDLE;
|
||||||
@@ -1163,8 +1165,6 @@ SQLRETURN SQL_API SQLFreeStmt(
|
|||||||
/* Bound parameters not currently implemented */
|
/* Bound parameters not currently implemented */
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
free(stmt->ole_str);
|
|
||||||
stmt->ole_str = NULL;
|
|
||||||
return SQL_SUCCESS;
|
return SQL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user