]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: fix completion
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 7 Mar 2017 18:16:21 +0000 (19:16 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 7 Mar 2017 18:20:05 +0000 (19:20 +0100)
The return value from cmd_complete_command is a VECTOR_INDEX, not TMP.
Use the appropriate vector_only_index_free().

Fixes #223.

Reported-by: https://github.com/k0ste
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vtysh/vtysh.c

index 1b0dd8cd29210313393fb8a7637fc22e54d96dd8..48f608b8b2149dd551656ed92258d58c4a4432e8 100644 (file)
@@ -832,7 +832,7 @@ command_generator (const char *text, int state)
        vector_set (vline, NULL);
 
       if (matched)
-        XFREE (MTYPE_TMP, matched);
+        vector_only_index_free (matched);
       matched = cmd_complete_command (vline, vty, &complete_status);
       cmd_free_strvec (vline);
     }