mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 23:34:13 +08:00
mdbx: fix SIGSEGV in case mdbx_env_close_ex() called without mdbx_env_open().
This commit is contained in:
parent
3e9308eb0e
commit
24a8bdec49
@ -5387,8 +5387,9 @@ int __cold mdbx_env_close_ex(MDBX_env *env, int dont_sync) {
|
|||||||
if (unlikely(env->me_signature != MDBX_ME_SIGNATURE))
|
if (unlikely(env->me_signature != MDBX_ME_SIGNATURE))
|
||||||
return MDBX_EBADSIGN;
|
return MDBX_EBADSIGN;
|
||||||
|
|
||||||
if ((env->me_flags & MDBX_RDONLY) == 0) {
|
if (env->me_lck && (env->me_flags & MDBX_RDONLY) == 0) {
|
||||||
if (env->me_txn0->mt_owner && env->me_txn0->mt_owner != mdbx_thread_self())
|
if (env->me_txn0 && env->me_txn0->mt_owner &&
|
||||||
|
env->me_txn0->mt_owner != mdbx_thread_self())
|
||||||
return MDBX_BUSY;
|
return MDBX_BUSY;
|
||||||
if (!dont_sync)
|
if (!dont_sync)
|
||||||
rc = mdbx_env_sync(env, true);
|
rc = mdbx_env_sync(env, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user