From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 26DDB43040F for ; Sat, 22 Aug 2020 17:30:26 +0300 (MSK) References: <14bca5aab8484f9fcd0c93b29c183a8133b71d35.1597417321.git.imeevma@gmail.com> From: Vladislav Shpilevoy Message-ID: <7a30ccd3-c969-90af-88be-275f06c65ad3@tarantool.org> Date: Sat, 22 Aug 2020 16:30:24 +0200 MIME-Version: 1.0 In-Reply-To: <14bca5aab8484f9fcd0c93b29c183a8133b71d35.1597417321.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 08/10] box: add param_list to 'struct func' List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Thanks for the patch! > diff --git a/src/box/alter.cc b/src/box/alter.cc > index ba96d9c62..0914a7615 100644 > --- a/src/box/alter.cc > +++ b/src/box/alter.cc > @@ -3293,7 +3293,11 @@ func_def_new_from_tuple(struct tuple *tuple) > diag_set(OutOfMemory, def_sz, "malloc", "def"); > return NULL; > } > - auto def_guard = make_scoped_guard([=] { free(def); }); > + def->param_list = NULL; > + auto def_guard = make_scoped_guard([=] { > + free(def->param_list); > + free(def); > + }); Would be better to patch func_def_sizeof() and allocate in one block.