* [tarantool-patches] [PATCH] sql: clean up lemon acttab_free() a bit
@ 2019-01-09 11:57 Alexander Turenko
2019-01-09 14:42 ` [tarantool-patches] " n.pettik
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Turenko @ 2019-01-09 11:57 UTC (permalink / raw)
To: Nikita Pettik; +Cc: Alexander Turenko, tarantool-patches
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tarantool-patches] Re: [PATCH] sql: clean up lemon acttab_free() a bit
2019-01-09 11:57 [tarantool-patches] [PATCH] sql: clean up lemon acttab_free() a bit Alexander Turenko
@ 2019-01-09 14:42 ` n.pettik
0 siblings, 0 replies; 2+ messages in thread
From: n.pettik @ 2019-01-09 14:42 UTC (permalink / raw)
To: tarantool-patches; +Cc: Alexander Turenko
> On 9 Jan 2019, at 13:57, Alexander Turenko <alexander.turenko@tarantool.org> wrote:
>
> 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 );
> }
Previous patch was pushed without review.
This one LGTM as obvious.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-09 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 11:57 [tarantool-patches] [PATCH] sql: clean up lemon acttab_free() a bit Alexander Turenko
2019-01-09 14:42 ` [tarantool-patches] " n.pettik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox