Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: kostja@tarantool.org
Subject: [tarantool-patches] [PATCH 1/1] vinyl: fix memory leak on error in vy_history_apply
Date: Fri,  4 May 2018 21:07:51 +0300	[thread overview]
Message-ID: <a4d81cae9e181b5a20926026c555942fb6bd270b.1525457240.git.v.shpilevoy@tarantool.org> (raw)

---
Branch: https://github.com/tarantool/tarantool/tree/vy-fix-memleak

 src/box/vy_history.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/box/vy_history.c b/src/box/vy_history.c
index c1fe6c6af..7687e2d9f 100644
--- a/src/box/vy_history.c
+++ b/src/box/vy_history.c
@@ -100,10 +100,10 @@ vy_history_apply(struct vy_history *history, const struct key_def *cmp_def,
 		struct tuple *stmt = vy_apply_upsert(node->stmt, curr_stmt,
 						     cmp_def, format, true);
 		++*upserts_applied;
-		if (stmt == NULL)
-			return -1;
 		if (curr_stmt != NULL)
 			tuple_unref(curr_stmt);
+		if (stmt == NULL)
+			return -1;
 		curr_stmt = stmt;
 		node = rlist_prev_entry_safe(node, &history->stmts, link);
 	}
-- 
2.15.1 (Apple Git-101)

                 reply	other threads:[~2018-05-04 18:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4d81cae9e181b5a20926026c555942fb6bd270b.1525457240.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH 1/1] vinyl: fix memory leak on error in vy_history_apply' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox