From: Bruno Haible Date: Sun, 4 Nov 2018 18:31:19 +0000 (+0100) Subject: xgettext: JavaScript: Fix a memory leak. X-Git-Tag: v0.20~275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58b9357409f262eb0da07c1124bddcc84bbb1cc4;p=thirdparty%2Fgettext.git xgettext: JavaScript: Fix a memory leak. * gettext-tools/src/x-javascript.c (free_token): Free tp->string also for token_type_keyword. --- diff --git a/gettext-tools/src/x-javascript.c b/gettext-tools/src/x-javascript.c index 62a2efcce..09ddcfc17 100644 --- a/gettext-tools/src/x-javascript.c +++ b/gettext-tools/src/x-javascript.c @@ -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);