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 4E3A4270DE for ; Fri, 13 Jul 2018 06:26:12 -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 HcZD98SFyzsI for ; Fri, 13 Jul 2018 06:26:12 -0400 (EDT) Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 09502270D5 for ; Fri, 13 Jul 2018 06:26:11 -0400 (EDT) Received: from [185.6.245.156] (port=34187 helo=msk-wire-v_shpilevoy-v.shpilevoy.mail.msk) by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1fdvH8-0005J5-AJ for tarantool-patches@freelists.org; Fri, 13 Jul 2018 13:26:10 +0300 Subject: [tarantool-patches] Re: [PATCH v1 2/2] sql: fixed possible leak in sqlite3EndTable References: From: Vladislav Shpilevoy Message-ID: <08d51d31-a944-e308-c1c2-bf823581607e@tarantool.org> Date: Fri, 13 Jul 2018 13:26:09 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Thanks for the patch! See 1 comment below. On 12/07/2018 19:34, Kirill Shcherbatov wrote: > --- > src/box/sql/build.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/src/box/sql/build.c b/src/box/sql/build.c > index 946b10c..200f7e8 100644 > --- a/src/box/sql/build.c > +++ b/src/box/sql/build.c > @@ -1795,7 +1795,7 @@ sqlite3EndTable(Parse * pParse, /* Parse context */ > */ > struct ExprList *old_checks = p->def->opts.checks; > if (sql_table_def_rebuild(db, p) != 0) > - return; > + goto cleanup; > sql_expr_list_delete(db, old_checks); > } I see two returns below this line. Why have not you replaced them with goto cleanup? > > @@ -1923,6 +1923,7 @@ sqlite3EndTable(Parse * pParse, /* Parse context */ > * don't require make a copy on space_def_dup and to improve > * debuggability. > */ > +cleanup: > sql_expr_list_delete(db, p->def->opts.checks); > p->def->opts.checks = NULL; > } >