mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:04:12 +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
|
||||
|
||||
bailout:
|
||||
#if defined(MDBX_USE_VALGRIND) || defined(__SANITIZE_ADDRESS__)
|
||||
mdbx_txn_valgrind(env, nullptr);
|
||||
#endif
|
||||
if (rc) {
|
||||
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__)
|
||||
mdbx_txn_valgrind(env, nullptr);
|
||||
#endif
|
||||
}
|
||||
mdbx_free(lck_pathname);
|
||||
return rc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user