aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHan Wu <wuhan9084@163.com>2021-12-02 20:13:24 +0800
committerDamjan Marion <dmarion@me.com>2021-12-08 17:53:13 +0000
commitefb64836f1e6c486e3d6b0cab3d6337d380cd6c7 (patch)
treeca50a41463cdfb571ff88872c8a0860f5d81545f /src
parent0eb83f484cc74b7ab4e26f6811a3e98442a25e7d (diff)
memif: fix the memory leak when memif cli getting wrong parameters inputs
Type: fix Signed-off-by: Han Wu <wuhan9084@163.com> Change-Id: I0aeafd273b3d1d01df02d638c72461943f91ef90
Diffstat (limited to 'src')
-rw-r--r--src/plugins/memif/cli.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/memif/cli.c b/src/plugins/memif/cli.c
index 056364c3e4a..19f624aa07b 100644
--- a/src/plugins/memif/cli.c
+++ b/src/plugins/memif/cli.c
@@ -53,6 +53,7 @@ memif_socket_filename_create_command_fn (vlib_main_t * vm,
else
{
vec_free (socket_filename);
+ unformat_free (line_input);
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);
}
@@ -125,6 +126,7 @@ memif_socket_filename_delete_command_fn (vlib_main_t * vm,
;
else
{
+ unformat_free (line_input);
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);
}
@@ -213,8 +215,11 @@ memif_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
unformat_ethernet_address, args.hw_addr))
args.hw_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);
@@ -289,8 +294,11 @@ memif_delete_command_fn (vlib_main_t * vm, unformat_input_t * input,
vnm, &sw_if_index))
;
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);