mirror of
https://github.com/status-im/sqlcipher.git
synced 2025-02-23 17:28:17 +00:00
Prevent deadlock of database mutex
This commit is contained in:
parent
d7120d73b4
commit
e873a49d99
@ -365,7 +365,11 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
|
||||
/* point the internal codec argument against the contet to be prepared */
|
||||
rc = sqlcipher_codec_ctx_init(&ctx, pDb, pDb->pBt->pBt->pPager, fd, zKey, nKey);
|
||||
|
||||
if(rc != SQLITE_OK) return rc; /* initialization failed, do not attach potentially corrupted context */
|
||||
if(rc != SQLITE_OK) {
|
||||
/* initialization failed, do not attach potentially corrupted context */
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
sqlite3pager_sqlite3PagerSetCodec(sqlite3BtreePager(pDb->pBt), sqlite3Codec, NULL, sqlite3FreeCodecArg, (void *) ctx);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user