From: Quentin Young Date: Wed, 3 Aug 2016 19:49:02 +0000 (+0000) Subject: lib: Fix use after free in matcher X-Git-Tag: frr-3.0-branchpoint~129^2~266 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8aeffd7ae1aac2552f67aa8b2c7708b4d41c4d55;p=matthieu%2Ffrr.git lib: Fix use after free in matcher Signed-off-by: Quentin Young --- diff --git a/lib/command_match.c b/lib/command_match.c index 5ba1c1b6e7..305e3b1a68 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -272,14 +272,15 @@ match_command_complete (struct graph_node *start, const char *line) * current = set of all transitions from the previous input token * next = set of all nodes reachable from all nodes in `matched` */ - list_free (current); - cmd_free_strvec(vline); matcher_result_value = idx + 1 == vector_active(vline) && next->count ? MATCHER_OK : MATCHER_NO_MATCH; + list_free (current); + cmd_free_strvec(vline); + return next; }