Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH 1/1] vinyl: fix memory leak on error in vy_history_apply
@ 2018-05-04 18:07 Vladislav Shpilevoy
  0 siblings, 0 replies; only message in thread
From: Vladislav Shpilevoy @ 2018-05-04 18:07 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

---
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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-04 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04 18:07 [tarantool-patches] [PATCH 1/1] vinyl: fix memory leak on error in vy_history_apply Vladislav Shpilevoy

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