From e8ae506773ca58f06b86a60164470956381de1d7 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Fri, 2 Feb 2018 19:06:14 +0300 Subject: [PATCH] mdbx: minor refine env-init. --- src/mdbx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index e8c07666..35fc2f84 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -5284,8 +5284,8 @@ int __cold mdbx_env_open_ex(MDBX_env *env, const char *path, unsigned flags, env->me_path = mdbx_strdup(path); env->me_dbxs = calloc(env->me_maxdbs, sizeof(MDBX_dbx)); - env->me_dbflags = calloc(env->me_maxdbs, sizeof(uint16_t)); - env->me_dbiseqs = calloc(env->me_maxdbs, sizeof(unsigned)); + env->me_dbflags = calloc(env->me_maxdbs, sizeof(env->me_dbflags[0])); + env->me_dbiseqs = calloc(env->me_maxdbs, sizeof(env->me_dbiseqs[0])); if (!(env->me_dbxs && env->me_path && env->me_dbflags && env->me_dbiseqs)) { rc = MDBX_ENOMEM; goto bailout; @@ -10365,8 +10365,8 @@ static int mdbx_dbi_close_locked(MDBX_env *env, MDBX_dbi dbi) { env->me_dbxs[dbi].md_name.iov_base = NULL; env->me_dbxs[dbi].md_name.iov_len = 0; - env->me_dbflags[dbi] = 0; env->me_dbiseqs[dbi]++; + env->me_dbflags[dbi] = 0; free(ptr); return MDBX_SUCCESS; }