]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: JavaScript: Fix a memory leak.
authorBruno Haible <bruno@clisp.org>
Sun, 4 Nov 2018 18:31:19 +0000 (19:31 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Nov 2018 18:31:19 +0000 (19:31 +0100)
* gettext-tools/src/x-javascript.c (free_token): Free tp->string also for
token_type_keyword.

gettext-tools/src/x-javascript.c

index 62a2efccee429c5b2e229405c1cd30e9c7ba3230..09ddcfc175c3ab3dc0a734e1ca939a4f08ef808e 100644 (file)
@@ -753,7 +753,8 @@ struct token_ty
 static inline void
 free_token (token_ty *tp)
 {
-  if (tp->type == token_type_string || tp->type == token_type_symbol)
+  if (tp->type == token_type_string || tp->type == token_type_symbol
+      || tp->type == token_type_keyword)
     free (tp->string);
   if (tp->type == token_type_string)
     drop_reference (tp->comment);