mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 23:04:13 +08:00
mdbx: fix null-deref in an ASAN-enabled build while opening DB with error.
More for https://github.com/erthink/libmdbx/issues/95 Change-Id: I6250fe7b0fbbcae497c2b5c1da9b4e9f78ecf0f0
This commit is contained in:
parent
17d7d48281
commit
c590eb656f
@ -10148,12 +10148,13 @@ int __cold mdbx_env_open(MDBX_env *env, const char *pathname, unsigned flags,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bailout:
|
bailout:
|
||||||
|
if (rc != MDBX_SUCCESS) {
|
||||||
|
rc = mdbx_env_close0(env) ? MDBX_PANIC : rc;
|
||||||
|
env->me_flags = saved_me_flags | MDBX_FATAL_ERROR;
|
||||||
|
} else {
|
||||||
#if defined(MDBX_USE_VALGRIND) || defined(__SANITIZE_ADDRESS__)
|
#if defined(MDBX_USE_VALGRIND) || defined(__SANITIZE_ADDRESS__)
|
||||||
mdbx_txn_valgrind(env, nullptr);
|
mdbx_txn_valgrind(env, nullptr);
|
||||||
#endif
|
#endif
|
||||||
if (rc) {
|
|
||||||
rc = mdbx_env_close0(env) ? MDBX_PANIC : rc;
|
|
||||||
env->me_flags = saved_me_flags | MDBX_FATAL_ERROR;
|
|
||||||
}
|
}
|
||||||
mdbx_free(lck_pathname);
|
mdbx_free(lck_pathname);
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user