From 952d4e7fb9fce28c36f8ff05a0a20ce528aa45f7 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 29 Apr 2019 17:27:24 +0200 Subject: vppinfra: add clib_mem_free_s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IPsec zero-es all allocated key memory including memory sur-allocated by the allocator. Move it to its own function in clib mem infra to make it easier to instrument. Type: refactor Change-Id: Icd1c44d18b741e723864abce75ac93e2eff74b61 Signed-off-by: Benoît Ganne (cherry picked from commit 78af0a8c5ff1a33ff8dccb1b2ea6ffadb8ef7b62) --- src/plugins/crypto_ipsecmb/ipsecmb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/plugins/crypto_ipsecmb') diff --git a/src/plugins/crypto_ipsecmb/ipsecmb.c b/src/plugins/crypto_ipsecmb/ipsecmb.c index fccc697cba3..7428e99171f 100644 --- a/src/plugins/crypto_ipsecmb/ipsecmb.c +++ b/src/plugins/crypto_ipsecmb/ipsecmb.c @@ -402,9 +402,7 @@ crypto_ipsecmb_key_handler (vlib_main_t * vm, vnet_crypto_key_op_t kop, if (imbm->key_data[idx] == 0) return; - clib_memset_u8 (imbm->key_data[idx], 0, - clib_mem_size (imbm->key_data[idx])); - clib_mem_free (imbm->key_data[idx]); + clib_mem_free_s (imbm->key_data[idx]); imbm->key_data[idx] = 0; return; } @@ -416,9 +414,7 @@ crypto_ipsecmb_key_handler (vlib_main_t * vm, vnet_crypto_key_op_t kop, if (kop == VNET_CRYPTO_KEY_OP_MODIFY && imbm->key_data[idx]) { - clib_memset_u8 (imbm->key_data[idx], 0, - clib_mem_size (imbm->key_data[idx])); - clib_mem_free (imbm->key_data[idx]); + clib_mem_free_s (imbm->key_data[idx]); } kd = imbm->key_data[idx] = clib_mem_alloc_aligned (ad->data_size, -- cgit 1.2.3-korg