aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2022-01-06 15:15:11 -0800
committerDamjan Marion <dmarion@me.com>2022-01-07 13:20:14 +0000
commite88c93324ae5bb4d86ffe239172022f112a5d63a (patch)
treef4f25792d12b20c3c94a4ee81179f4c197fb6045 /src
parent5c954c4641c7894636aa0533634ef4f5a6bed615 (diff)
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: df7f8e8cffcc43531f7daeda44d436b60e538141 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I2663894c6cb8066ca2abb1c56f0ca46d0fef19f7
Diffstat (limited to 'src')
-rw-r--r--src/plugins/vmxnet3/cli.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/vmxnet3/cli.c b/src/plugins/vmxnet3/cli.c
index 574d86fe220..039e9f3a75b 100644
--- a/src/plugins/vmxnet3/cli.c
+++ b/src/plugins/vmxnet3/cli.c
@@ -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,