From 181b4767c0bfd3db0f8792caa55f276afbf23dda Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 26 Apr 2017 14:47:10 +0200 Subject: [PATCH] parse_DATA_LIST_vars: Reduce scope of variable 'name2' --- src/language/lexer/variable-parser.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/language/lexer/variable-parser.c b/src/language/lexer/variable-parser.c index d160b6f979..9819acbbc1 100644 --- a/src/language/lexer/variable-parser.c +++ b/src/language/lexer/variable-parser.c @@ -428,7 +428,7 @@ parse_DATA_LIST_vars (struct lexer *lexer, const struct dictionary *dict, struct stringi_set set; char *name1 = NULL; - char *name2 = NULL; + bool ok = false; assert ((pv_opts & ~(PV_APPEND | PV_SINGLE @@ -472,7 +472,8 @@ parse_DATA_LIST_vars (struct lexer *lexer, const struct dictionary *dict, lex_get (lexer); if (lex_token (lexer) == T_TO) { - unsigned long int num1, num2; + char *name2 = NULL; + unsigned long int num1, num2; int n_digits1, n_digits2; int root_len1, root_len2; unsigned long int number; @@ -522,7 +523,6 @@ parse_DATA_LIST_vars (struct lexer *lexer, const struct dictionary *dict, free (name1); name1 = NULL; free (name2); - name2 = NULL; } else { @@ -557,7 +557,6 @@ exit: *n_varsp = 0; free (name1); - free (name2); } return ok; } -- 2.30.2