aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-01-22 18:27:43 -0800
committerDave Barach <vpp@barachs.net>2024-01-23 17:50:52 +0000
commit3109d1c29872a18642088b05fa1e2e2291241cc3 (patch)
tree562e0cb8f529daee9968bac50025165dc86b92b5
parent1effb29aa2c3e9179192dd3919c8d849fcb08dae (diff)
tls: fix ho leak on tcp connect return
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I40345d635b8067dcffbbdd39d0a5b0c0934a6d54
-rw-r--r--src/vnet/tls/tls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 7c84f15e9e0..a27d731aca0 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -824,7 +824,10 @@ tls_connect (transport_endpoint_cfg_t * tep)
cargs->api_context = ctx_index;
cargs->sep_ext.ns_index = app->ns_index;
if ((rv = vnet_connect (cargs)))
- return rv;
+ {
+ tls_ctx_half_open_free (ctx_index);
+ return rv;
+ }
/* Track half-open tcp session in case we need to clean it up */
ctx->tls_session_handle = cargs->sh;