summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-12 23:22:01 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-05-12 23:22:01 +0000
commit2fe8aba3a09b3e2a64ee1861d8eeb389efaf1eb0 (patch)
treef2c18e4f6c17430fccf12efdc76a9e9e6041e2ef /lib/vty.c
parentd2519962b71b512eb5fd55a378f8ef748d17c30f (diff)
[lib] CID #39, fix leak in error path, vty_describe_command
2006-05-12 Paul Jakma <paul.jakma@sun.com> * vty.c: (vty_describe_command) fix leak of describe vector in error path, CID #39.
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 206af065..98f6494e 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -985,18 +985,12 @@ vty_describe_command (struct vty *vty)
switch (ret)
{
case CMD_ERR_AMBIGUOUS:
- cmd_free_strvec (vline);
vty_out (vty, "%% Ambiguous command.%s", VTY_NEWLINE);
- vty_prompt (vty);
- vty_redraw_line (vty);
- return;
+ goto out;
break;
case CMD_ERR_NO_MATCH:
- cmd_free_strvec (vline);
vty_out (vty, "%% There is no matched command.%s", VTY_NEWLINE);
- vty_prompt (vty);
- vty_redraw_line (vty);
- return;
+ goto out;
break;
}
@@ -1066,6 +1060,7 @@ vty_describe_command (struct vty *vty)
vty_describe_fold (vty, width, desc_width, desc);
}
+out:
cmd_free_strvec (vline);
vector_free (describe);