From 09e61a383facd3c9e3e52162e98302c7cba15ecc Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 7 Mar 2017 19:16:21 +0100 Subject: [PATCH] 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 --- vtysh/vtysh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 1b0dd8cd29..48f608b8b2 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -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); }