summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-09-13 08:38:32 -0400
committerGitHub <noreply@github.com>2018-09-13 08:38:32 -0400
commit6efca3442f9e74c789803cbcfba330cd12de7863 (patch)
treec9f2e7511ba0ee99ec763c86f5c0a21fa14b293d /lib/command_match.c
parentfc6eb7d827d7373a89dd04c1d809059e9ef79f9e (diff)
parentc683bd446c59dc09d4b19eb47718b014c433d900 (diff)
Merge pull request #3007 from pacovn/static_analysis__shadow_variables2
lib vtysh zebra: variable shadowing fixes
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index c165305d78..a1ae3ac6b9 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -195,7 +195,7 @@ static enum matcher_rv command_match_r(struct graph_node *start, vector vline,
enum matcher_rv status = MATCHER_NO_MATCH;
// get the minimum match level that can count as a full match
- struct cmd_token *token = start->data;
+ struct cmd_token *copy, *token = start->data;
enum match_type minmatch = min_match_level(token->type);
/* check history/stack of tokens
@@ -326,8 +326,8 @@ static enum matcher_rv command_match_r(struct graph_node *start, vector vline,
}
if (*currbest) {
// copy token, set arg and prepend to currbest
- struct cmd_token *token = start->data;
- struct cmd_token *copy = cmd_token_dup(token);
+ token = start->data;
+ copy = cmd_token_dup(token);
copy->arg = XSTRDUP(MTYPE_CMD_ARG, input_token);
listnode_add_before(*currbest, (*currbest)->head, copy);
} else if (n + 1 == vector_active(vline) && status == MATCHER_NO_MATCH)