mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 21:01:42 +00:00
[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.
This commit is contained in:
parent
d2519962b7
commit
2fe8aba3a0
@ -4,6 +4,8 @@
|
|||||||
of prefix and typestr strings, Coverity CID #3.
|
of prefix and typestr strings, Coverity CID #3.
|
||||||
* command.c: (cmd_complete_command_real) Fix leak of cmd_vector
|
* command.c: (cmd_complete_command_real) Fix leak of cmd_vector
|
||||||
in error case, Coverity CID #37.
|
in error case, Coverity CID #37.
|
||||||
|
* vty.c: (vty_describe_command) fix leak of describe vector in
|
||||||
|
error path, CID #39.
|
||||||
|
|
||||||
2006-03-30 Paul Jakma <paul.jakma@sun.com>
|
2006-03-30 Paul Jakma <paul.jakma@sun.com>
|
||||||
|
|
||||||
|
11
lib/vty.c
11
lib/vty.c
@ -985,18 +985,12 @@ vty_describe_command (struct vty *vty)
|
|||||||
switch (ret)
|
switch (ret)
|
||||||
{
|
{
|
||||||
case CMD_ERR_AMBIGUOUS:
|
case CMD_ERR_AMBIGUOUS:
|
||||||
cmd_free_strvec (vline);
|
|
||||||
vty_out (vty, "%% Ambiguous command.%s", VTY_NEWLINE);
|
vty_out (vty, "%% Ambiguous command.%s", VTY_NEWLINE);
|
||||||
vty_prompt (vty);
|
goto out;
|
||||||
vty_redraw_line (vty);
|
|
||||||
return;
|
|
||||||
break;
|
break;
|
||||||
case CMD_ERR_NO_MATCH:
|
case CMD_ERR_NO_MATCH:
|
||||||
cmd_free_strvec (vline);
|
|
||||||
vty_out (vty, "%% There is no matched command.%s", VTY_NEWLINE);
|
vty_out (vty, "%% There is no matched command.%s", VTY_NEWLINE);
|
||||||
vty_prompt (vty);
|
goto out;
|
||||||
vty_redraw_line (vty);
|
|
||||||
return;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1066,6 +1060,7 @@ vty_describe_command (struct vty *vty)
|
|||||||
vty_describe_fold (vty, width, desc_width, desc);
|
vty_describe_fold (vty, width, desc_width, desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
cmd_free_strvec (vline);
|
cmd_free_strvec (vline);
|
||||||
vector_free (describe);
|
vector_free (describe);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user