From 8aeffd7ae1aac2552f67aa8b2c7708b4d41c4d55 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 3 Aug 2016 19:49:02 +0000 Subject: [PATCH] lib: Fix use after free in matcher Signed-off-by: Quentin Young --- lib/command_match.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.39.5