From f2335b7840b645154de426ec6f5f77d6ef162675 Mon Sep 17 00:00:00 2001 From: inderpalpatheja <30344765+inderpalpatheja@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:23:38 +0530 Subject: [PATCH] Update kernel_vpp_ipsec.c There was an issue in del_sa function where if there is no SA found due to any reason then it would fall into error label where it would try to free mp memory which get allocated later down in this function. --- extras/strongswan/vpp_sswan/kernel_vpp_ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extras/strongswan/vpp_sswan/kernel_vpp_ipsec.c b/extras/strongswan/vpp_sswan/kernel_vpp_ipsec.c index e1c71edc836a..909e96f97cd5 100644 --- a/extras/strongswan/vpp_sswan/kernel_vpp_ipsec.c +++ b/extras/strongswan/vpp_sswan/kernel_vpp_ipsec.c @@ -1795,7 +1795,8 @@ METHOD (kernel_ipsec_t, del_sa, status_t, private_kernel_vpp_ipsec_t *this, { DBG1 (DBG_KNL, "SA not found"); rv = NOT_FOUND; - goto error; + this->mutex->unlock (this->mutex); + return rv; } mp = vl_msg_api_alloc (sizeof (*mp)); memset (mp, 0, sizeof (*mp));