Merge pull request #1397 from qlyoung/fix-vtysh-completions-npd

vtysh: protect null deref for cli completions
This commit is contained in:
Renato Westphal 2017-11-03 08:27:12 -02:00 committed by GitHub
commit 5f615b1055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -820,7 +820,8 @@ static int vtysh_rl_describe(void)
break;
case CMD_ERR_NO_MATCH:
cmd_free_strvec(vline);
vector_free(describe);
if (describe)
vector_free(describe);
fprintf(stdout, "%% There is no matched command.\n");
rl_on_new_line();
return 0;