vmxnet3: memory leak on parsing bad CLI command

When parsing bad "create interface vmxnet3" command, we should call
unformat_free prior to return

Type: fix
Fixes: df7f8e8cff

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I2663894c6cb8066ca2abb1c56f0ca46d0fef19f7
This commit is contained in:
Steven Luong
2022-01-06 15:15:11 -08:00
committed by Damjan Marion
parent 5c954c4641
commit e88c93324a

View File

@@ -58,12 +58,14 @@ vmxnet3_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
else if (unformat (line_input, "num-rx-queues %u", &size))
args.rxq_num = size;
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);
vmxnet3_create_if (vm, &args);
if (args.error == 0)
vlib_cli_output (vm, "%U\n", format_vnet_sw_if_index_name,