1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix a problem that could cause a crash if a blob handle were closed after the associated database handle was closed using sqlite3_close_v2().

FossilOrigin-Name: 52f463d29407fad691c42b13462880e7605603c9be9f480d18e953a0ef78149a
This commit is contained in:
dan
2019-07-15 13:58:28 +00:00
parent 08e2e8e680
commit e464802d49
4 changed files with 18 additions and 10 deletions

View File

@@ -355,11 +355,12 @@ int sqlite3_blob_close(sqlite3_blob *pBlob){
sqlite3 *db;
if( p ){
sqlite3_stmt *pStmt = p->pStmt;
db = p->db;
sqlite3_mutex_enter(db->mutex);
rc = sqlite3_finalize(p->pStmt);
sqlite3DbFree(db, p);
sqlite3_mutex_leave(db->mutex);
rc = sqlite3_finalize(pStmt);
}else{
rc = SQLITE_OK;
}