From 76dc22cec340b1c32e82a9ef9b6baff8006a6517 Mon Sep 17 00:00:00 2001 From: Swarup Nayak Date: Tue, 5 Dec 2017 09:46:17 +0530 Subject: call unformat_free in some flow, remove unnecessary calls Change-Id: I565277eafbce3d4f59a7f0d497fca1c4fed3cfc8 Signed-off-by: Swarup Nayak --- src/vnet/devices/tap/cli.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/vnet/devices') 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); } -- cgit 1.2.3-korg