aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorSwarup Nayak <swarupnpvt@gmail.com>2017-12-05 09:46:17 +0530
committerFlorin Coras <florin.coras@gmail.com>2017-12-11 04:03:03 +0000
commit76dc22cec340b1c32e82a9ef9b6baff8006a6517 (patch)
tree66e503df446d40207ee2dd5994da1e4de8f601e0 /src/vnet
parentf32cff69f1c48bbb0b8dd563be41b26ab388d188 (diff)
call unformat_free in some flow, remove unnecessary calls
Change-Id: I565277eafbce3d4f59a7f0d497fca1c4fed3cfc8 Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/tap/cli.c8
-rw-r--r--src/vnet/ip/lookup.c16
2 files changed, 17 insertions, 7 deletions
diff --git a/src/vnet/devices/tap/cli.c b/src/vnet/devices/tap/cli.c
index c86995ce5cc..7dd525b169d 100644
--- a/src/vnet/devices/tap/cli.c
+++ b/src/vnet/devices/tap/cli.c
@@ -43,7 +43,6 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
/* Get a line of input. */
if (unformat_user (input, unformat_line_input, line_input))
{
-
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "id %u", &args.id))
@@ -74,8 +73,11 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
unformat_ethernet_address, args.mac_addr))
args.mac_addr_set = 1;
else
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, input);
+ {
+ unformat_free (line_input);
+ return clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, input);
+ }
}
unformat_free (line_input);
}
diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c
index 95039bdf116..67e46bd8cfa 100644
--- a/src/vnet/ip/lookup.c
+++ b/src/vnet/ip/lookup.c
@@ -1398,12 +1398,16 @@ ip_container_cmd (vlib_main_t * vm,
else if (unformat (line_input, "del"))
is_del = 1;
else
- return (clib_error_return (0, "unknown input '%U'",
- format_unformat_error, line_input));
+ {
+ unformat_free (line_input);
+ return (clib_error_return (0, "unknown input '%U'",
+ format_unformat_error, line_input));
+ }
}
if (~0 == sw_if_index || !addr_set)
{
+ unformat_free (line_input);
vlib_cli_output (vm, "interface and address must be set");
return 0;
}
@@ -1456,12 +1460,16 @@ show_ip_container_cmd_fn (vlib_main_t * vm, unformat_input_t * main_input,
unformat_vnet_sw_interface, vnm, &sw_if_index))
;
else
- return (clib_error_return (0, "unknown input '%U'",
- format_unformat_error, line_input));
+ {
+ unformat_free (line_input);
+ return (clib_error_return (0, "unknown input '%U'",
+ format_unformat_error, line_input));
+ }
}
if (~0 == sw_if_index)
{
+ unformat_free (line_input);
vlib_cli_output (vm, "no interface");
return (clib_error_return (0, "no interface"));
}