From 803c1623c255a6ffbc41e81a1bbd17bffba2ed05 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Tue, 5 Jan 2021 17:47:59 +0100 Subject: acl: fix cli tag parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tag is expected to be 64-bytes - when specifying tag on cli, a vector is allocated. Make sure it is freed Type: fix Change-Id: Id1741fe406819ca9f71edb081d4483f52cae547d Signed-off-by: Benoît Ganne --- src/plugins/acl/acl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/acl/acl.c b/src/plugins/acl/acl.c index 35f8b8cb82d..7cde5ce60ad 100644 --- a/src/plugins/acl/acl.c +++ b/src/plugins/acl/acl.c @@ -2828,7 +2828,7 @@ acl_set_aclplugin_acl_fn (vlib_main_t * vm, u32 tcpflags, tcpmask; u32 src_prefix_length = 0, dst_prefix_length = 0; ip46_address_t src, dst; - u8 *tag = (u8 *) "cli"; + u8 *tag = 0; if (!unformat_user (input, unformat_line_input, line_input)) return 0; @@ -2934,10 +2934,14 @@ acl_set_aclplugin_acl_fn (vlib_main_t * vm, } u32 acl_index = ~0; + if (!tag) + vec_add (tag, "cli", 4); + vec_validate (tag, STRUCT_SIZE_OF (acl_list_t, tag) - 1); rv = acl_add_list (vec_len (rules), rules, &acl_index, tag); vec_free (rules); + vec_free (tag); if (rv) return (clib_error_return (0, "failed")); -- cgit 1.2.3-korg