]> git.puffer.fish Git - mirror/frr.git/commitdiff
[lib] CID #39, fix leak in error path, vty_describe_command
authorPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:22:01 +0000 (23:22 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:22:01 +0000 (23:22 +0000)
2006-05-12 Paul Jakma <paul.jakma@sun.com>

* vty.c: (vty_describe_command) fix leak of describe vector in
  error path, CID #39.

lib/ChangeLog
lib/vty.c

index dc9999b380e849dbf02d62369edd7497c4a7fc4a..467274738eb1e68f158e14915bd75f7cd5f15809 100644 (file)
@@ -4,6 +4,8 @@
          of prefix and typestr strings, Coverity CID #3.
        * command.c: (cmd_complete_command_real) Fix leak of cmd_vector
          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>
 
index 206af065cffade84c6ee58a4578b9765c52b7229..98f6494e257fe4295880662b99fedffb42973341 100644 (file)
--- 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);