aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2022-01-06 13:02:00 -0800
committerDamjan Marion <dmarion@me.com>2022-01-07 13:21:37 +0000
commited999e3b8159eb5b584354af95686a84fb012e05 (patch)
tree6d5542d3ffcdbe1ccac948c752d0d4ff6ae1d11d /src/vnet
parente88c93324ae5bb4d86ffe239172022f112a5d63a (diff)
bonding: memory leak on parsing bad CLI command
When parsing bad "create bond" command, we should call unformat_free prior to return Type: fix Fixes: 9cd2d7a5a4fafadb65d772c48109d55d1e19d425 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I8f20a0e7f29de670e09633880d0aa50a51444e11
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/bonding/cli.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c
index 62bbbdae75c..d20c68606d8 100644
--- a/src/vnet/bonding/cli.c
+++ b/src/vnet/bonding/cli.c
@@ -510,12 +510,18 @@ bond_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
if (args.mode == BOND_MODE_LACP)
args.numa_only = 1;
else
- return clib_error_return (0,
- "Only lacp mode supports numa-only so far!");
+ {
+ unformat_free (line_input);
+ return clib_error_return (
+ 0, "Only lacp mode supports numa-only so far!");
+ }
}
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);