From 6efe0686c95257b04a0f3981ea7ca63779b22c97 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 6 Oct 2019 19:05:08 +0300 Subject: [PATCH] mdbx: fix Coverity warnings. Change-Id: I70734c5bf7e3d1088522c0dccd88948865f8192f --- src/elements/core.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index d06b883a..e7c9d39f 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -11919,9 +11919,9 @@ static int mdbx_page_split(MDBX_cursor *mc, const MDBX_val *newkey, unsigned newindx = mc->mc_ki[mc->mc_top]; unsigned nkeys = NUMKEYS(mp); if (mdbx_audit_enabled()) { - int err = mdbx_cursor_check(mc, true); - if (unlikely(err != MDBX_SUCCESS)) - return err; + rc = mdbx_cursor_check(mc, true); + if (unlikely(rc != MDBX_SUCCESS)) + return rc; } mdbx_debug("-----> splitting %s page %" PRIaPGNO @@ -12123,12 +12123,12 @@ static int mdbx_page_split(MDBX_cursor *mc, const MDBX_val *newkey, mdbx_debug("separator is %d [%s]", split_indx, DKEY(&sepkey)); if (mdbx_audit_enabled()) { - int err = mdbx_cursor_check(mc, true); - if (unlikely(err != MDBX_SUCCESS)) - return err; - err = mdbx_cursor_check(&mn, true); - if (unlikely(err != MDBX_SUCCESS)) - return err; + rc = mdbx_cursor_check(mc, true); + if (unlikely(rc != MDBX_SUCCESS)) + goto done; + rc = mdbx_cursor_check(&mn, true); + if (unlikely(rc != MDBX_SUCCESS)) + goto done; } /* Copy separator key to the parent. */ @@ -12145,9 +12145,9 @@ static int mdbx_page_split(MDBX_cursor *mc, const MDBX_val *newkey, goto done; mdbx_cassert(mc, mc->mc_snum - snum == mc->mc_db->md_depth - depth); if (mdbx_audit_enabled()) { - int err = mdbx_cursor_check(mc, true); - if (unlikely(err != MDBX_SUCCESS)) - return err; + rc = mdbx_cursor_check(mc, true); + if (unlikely(rc != MDBX_SUCCESS)) + goto done; } /* root split? */