tls: free app session if connect notify refused
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iee6784c37a835b49d962ae6f87c279cbe65dde15
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 3a781eb..c168995 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -265,8 +265,8 @@
parent_app_api_ctx))
{
TLS_DBG (1, "failed to notify app");
- app_session->session_state = SESSION_STATE_CONNECTING;
- tls_disconnect (ctx->tls_ctx_handle, vlib_get_thread_index ());
+ session_free (session_get (ctx->c_s_index, ctx->c_thread_index));
+ ctx->no_app_session = 1;
return -1;
}