[tarantool-patches] [PATCH] sql: clean up lemon acttab_free() a bit

Alexander Turenko alexander.turenko at tarantool.org
Wed Jan 9 14:57:56 MSK 2019


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





More information about the Tarantool-patches mailing list