From e70994fdd531b39b60e796b8e97d1be0163ebd11 Mon Sep 17 00:00:00 2001
From: kristof <Kristof.Szabados@ericsson.com>
Date: Sat, 1 Apr 2017 17:28:59 +0200
Subject: [PATCH] correct the memory leak that appears when a syntax error is
 found in a templatelist.

Signed-off-by: kristof <Kristof.Szabados@ericsson.com>
---
 compiler2/ttcn3/compiler.y | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/compiler2/ttcn3/compiler.y b/compiler2/ttcn3/compiler.y
index 476095e5d..f63542859 100644
--- a/compiler2/ttcn3/compiler.y
+++ b/compiler2/ttcn3/compiler.y
@@ -130,7 +130,6 @@ static const string anyname("anytype");
   bool bool_val; /* boolean value */
   char *str; /* simple string value */
   unsigned char uchar_val;
-
   int_val_t *int_val; /* integer value */
   Real float_val; /* float value */
   Identifier *id;
@@ -1867,7 +1866,7 @@ optDecodedModifier
 %left '*' '/' ModKeyword RemKeyword
 %left UnarySign
 
-%expect 63
+%expect 66
 
 %start GrammarRoot
 
@@ -3879,6 +3878,11 @@ ValueOrAttribList: // 142 is a Templates*
     $$ = $5;
     $$->add_front_t($2);
   }
+| '(' TemplateListElem optError ')'
+  {
+    $$ = new Templates;
+    $$->add_front_t($2);
+  }
 | '(' error TemplateListElem optError ',' seqValueOrAttrib optError ')'
   {
     $$ = $6;
-- 
GitLab