mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:04:12 +08:00
lmdb: fix segfault in mdb_chk when mdb_env_open() failed.
Change-Id: If72d35518c2d4dd33d284049e00fc633e65ee52c
This commit is contained in:
parent
65555273aa
commit
ad8c4a19bb
6
mdb.c
6
mdb.c
@ -2575,8 +2575,12 @@ mdb_env_sync(MDB_env *env, int force)
|
||||
int rc;
|
||||
pthread_mutex_t *mutex;
|
||||
MDB_meta *head;
|
||||
unsigned flags = env->me_flags & ~MDB_NOMETASYNC;
|
||||
unsigned flags;
|
||||
|
||||
if (unlikely(! env || ! env->me_txns))
|
||||
return EINVAL;
|
||||
|
||||
flags = env->me_flags & ~MDB_NOMETASYNC;
|
||||
if (unlikely(flags & (MDB_RDONLY | MDB_FATAL_ERROR)))
|
||||
return EACCES;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user