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 0453F23636 for ; Wed, 9 Jan 2019 09:42:21 -0500 (EST) 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 ByvI3KcXG4z5 for ; Wed, 9 Jan 2019 09:42:20 -0500 (EST) Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 566BA236C2 for ; Wed, 9 Jan 2019 09:42:20 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: [tarantool-patches] Re: [PATCH] sql: clean up lemon acttab_free() a bit From: "n.pettik" In-Reply-To: <200cdf0164eca9bc411c0b9277b78984c8df90db.1547035031.git.alexander.turenko@tarantool.org> Date: Wed, 9 Jan 2019 16:42:17 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <0FDE4101-E54C-4C68-81A0-79A1CED94E37@tarantool.org> References: <200cdf0164eca9bc411c0b9277b78984c8df90db.1547035031.git.alexander.turenko@tarantool.org> 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: Alexander Turenko > On 9 Jan 2019, at 13:57, Alexander Turenko = wrote: >=20 > Nikita Pettik suggests me that free(NULL) is no-op according to POSIX. >=20 > This is follow up of 9dbcaa3afae39cc46a8e6da5e00b5d62179ed016. > --- >=20 > no issue > = https://github.com/tarantool/tarantool/tree/Totktonada/fix-lemon-leak-foll= ow-up >=20 > extra/lemon.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/extra/lemon.c b/extra/lemon.c > index 1efaac9e6..f245e7cf7 100644 > --- a/extra/lemon.c > +++ b/extra/lemon.c > @@ -599,10 +599,8 @@ struct acttab { > /* Free all memory associated with the given acttab */ > void acttab_free(acttab *p){ > assert(p); > - if (p->aAction) > - free( p->aAction ); > - if (p->aLookahead) > - free( p->aLookahead ); > + free( p->aAction ); > + free( p->aLookahead ); > free( p ); > } Previous patch was pushed without review. This one LGTM as obvious.