From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4DE9123B90 for ; Fri, 4 May 2018 14:07:54 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ISnGH1_q3ToU for ; Fri, 4 May 2018 14:07:54 -0400 (EDT) Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 08AC023B28 for ; Fri, 4 May 2018 14:07:53 -0400 (EDT) From: Vladislav Shpilevoy 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 Message-Id: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: kostja@tarantool.org --- 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)