From e5cd706c1a4b8138e9b78933e03460f0b032c77e Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 15 Jun 2006 12:25:55 +0000 Subject: [lib] Fix vector leak in error path in command.c, CID #38 2006-06-15 Paul Jakma * command.c: (cmd_describe_command_real) Fix leak, CID #38. --- lib/command.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 07297eff..316971e4 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1,5 +1,5 @@ /* - $Id: command.c,v 1.53 2006/05/12 23:24:09 paul Exp $ + $Id$ Command interpreter routine for virtual terminal [aka TeletYpe] Copyright (C) 1997, 98, 99 Kunihiro Ishiguro @@ -1629,12 +1629,14 @@ cmd_describe_command_real (vector vline, struct vty *vty, int *status) if ((ret = is_cmd_ambiguous (command, cmd_vector, i, match)) == 1) { vector_free (cmd_vector); + vector_free (matchvec); *status = CMD_ERR_AMBIGUOUS; return NULL; } else if (ret == 2) { vector_free (cmd_vector); + vector_free (matchvec); *status = CMD_ERR_NO_MATCH; return NULL; } -- cgit v1.2.1