mdbx: fix minor memleak (Coverity).

This commit is contained in:
Leo Yuriev 2018-03-19 15:58:30 +03:00
parent c05d179035
commit 64613c9061

View File

@ -10460,13 +10460,13 @@ int mdbx_dbi_open_ex(MDBX_txn *txn, const char *table_name, unsigned user_flags,
!strncmp(table_name, txn->mt_dbxs[scan].md_name.iov_base, len)) { !strncmp(table_name, txn->mt_dbxs[scan].md_name.iov_base, len)) {
*dbi = scan; *dbi = scan;
rc = mdbx_dbi_bind(txn, scan, user_flags, keycmp, datacmp); rc = mdbx_dbi_bind(txn, scan, user_flags, keycmp, datacmp);
goto unlock_return_rc; goto bailout;
} }
} }
if (unlikely(slot >= env->me_maxdbs)) { if (unlikely(slot >= env->me_maxdbs)) {
rc = MDBX_DBS_FULL; rc = MDBX_DBS_FULL;
goto unlock_return_rc; goto bailout;
} }
unsigned dbflag = DB_FRESH | DB_VALID | DB_USRVALID; unsigned dbflag = DB_FRESH | DB_VALID | DB_USRVALID;
@ -10516,7 +10516,6 @@ int mdbx_dbi_open_ex(MDBX_txn *txn, const char *table_name, unsigned user_flags,
*dbi = slot; *dbi = slot;
} }
unlock_return_rc:
mdbx_ensure(env, mdbx_fastmutex_release(&env->me_dbi_lock) == MDBX_SUCCESS); mdbx_ensure(env, mdbx_fastmutex_release(&env->me_dbi_lock) == MDBX_SUCCESS);
return rc; return rc;
} }