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 0B8D12203E for ; Wed, 9 Jan 2019 06:57:55 -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 kfWN4J81MDn6 for ; Wed, 9 Jan 2019 06:57:54 -0500 (EST) Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 C005021C79 for ; Wed, 9 Jan 2019 06:57:54 -0500 (EST) From: Alexander Turenko Subject: [tarantool-patches] [PATCH] sql: clean up lemon acttab_free() a bit Date: Wed, 9 Jan 2019 14:57:56 +0300 Message-Id: <200cdf0164eca9bc411c0b9277b78984c8df90db.1547035031.git.alexander.turenko@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Nikita Pettik Cc: Alexander Turenko , tarantool-patches@freelists.org Nikita Pettik suggests me that free(NULL) is no-op according to POSIX. This is follow up of 9dbcaa3afae39cc46a8e6da5e00b5d62179ed016. --- no issue https://github.com/tarantool/tarantool/tree/Totktonada/fix-lemon-leak-follow-up extra/lemon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 ); } -- 2.20.1