mirror of
https://git.telodendria.io/Telodendria/Cytoplasm.git
synced 2024-11-23 04:28:49 +03:00
Merge pull request 'Fix LMDB use-after-free' (#53) from lda/Cytoplasm:fix-deadlock into master
Reviewed-on: https://git.telodendria.io/Telodendria/Cytoplasm/pulls/53
This commit is contained in:
commit
8987802437
1 changed files with 2 additions and 1 deletions
|
@ -293,6 +293,7 @@ LMDBUnlock(Db *d, DbRef *r)
|
|||
Stream *stream;
|
||||
MDB_val key, val;
|
||||
bool ret = true;
|
||||
DbHint hint = r ? r->hint : 0;
|
||||
|
||||
if (!d || !r)
|
||||
{
|
||||
|
@ -324,7 +325,7 @@ LMDBUnlock(Db *d, DbRef *r)
|
|||
{
|
||||
free(val.mv_data);
|
||||
}
|
||||
if (ret && r->hint == DB_HINT_WRITE)
|
||||
if (ret && hint == DB_HINT_WRITE)
|
||||
{
|
||||
pthread_mutex_unlock(&d->lock);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue