vlib: fix line-mode cli memory leak 07/29207/2
authorBenoît Ganne <bganne@cisco.com>
Thu, 1 Oct 2020 16:20:23 +0000 (18:20 +0200)
committerMatthew Smith <mgsmith@netgate.com>
Thu, 1 Oct 2020 20:58:01 +0000 (20:58 +0000)
Type: fix

Change-Id: Iaf60ec93ee9750074f52ba4dbe955355de5dbccc
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vlib/unix/cli.c

index e98eb34..2f34c8d 100644 (file)
@@ -2520,6 +2520,7 @@ unix_cli_line_edit (unix_cli_main_t * cm, unix_main_t * um,
          if (cf->line_mode)
            {
              vec_delete (cf->input_vector, i, 0);
+             vec_free (cf->current_command);
              cf->current_command = cf->input_vector;
              return 0;
            }