vtysh: fix completion

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>
This commit is contained in:
David Lamparter 2017-03-07 19:16:21 +01:00
parent fc2af2b729
commit 09e61a383f

View 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);
}