pipeline: fix IPsec crypto session leak
Checks
Commit Message
In case of rte_ipsec_session_prepare() error, the crypto session was
not freed, leading to its leakage.
Fixes: 20777eb5f913 ("pipeline: add IPsec")
Coverity issue: 383139
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/pipeline/rte_swx_ipsec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
07/02/2023 19:15, Cristian Dumitrescu:
> In case of rte_ipsec_session_prepare() error, the crypto session was
> not freed, leading to its leakage.
>
> Fixes: 20777eb5f913 ("pipeline: add IPsec")
> Coverity issue: 383139
>
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Applied, thanks.
@@ -1719,7 +1719,11 @@ ipsec_session_create(struct rte_swx_ipsec *ipsec,
s->pkt_func.prepare.async = NULL;
s->pkt_func.process = NULL;
- return rte_ipsec_session_prepare(s);
+ status = rte_ipsec_session_prepare(s);
+ if (status)
+ goto error;
+
+ return 0;
error:
/* sa. */