]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Fix use after free in matcher
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 3 Aug 2016 19:49:02 +0000 (19:49 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 3 Aug 2016 19:49:02 +0000 (19:49 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command_match.c

index 5ba1c1b6e76039e5684b95c26068bb1ee8b14b91..305e3b1a68ed826152dbea4bae615d8b0dc9a1f0 100644 (file)
@@ -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;
 }