From bf8e246f4c35b5bf1ea11f09e74dcd00b3ea13c2 Mon Sep 17 00:00:00 2001 From: Junyeon LEE Date: Fri, 23 Jun 2017 23:02:53 +0900 Subject: [PATCH] net/tls: fixes memory leakage in easy tls api. This commit is to fix memory leakage in easy tls api. Without this commit, tls_ctx and tls_session structures are not freed and remain in memory. Change-Id: Idea8bf2a44d1401e81f97a377a5480c580c96d92 Signed-off-by: Junyeon LEE --- os/net/tls/easy_tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os/net/tls/easy_tls.c b/os/net/tls/easy_tls.c index 7349b63..4ac2d20 100644 --- a/os/net/tls/easy_tls.c +++ b/os/net/tls/easy_tls.c @@ -293,6 +293,8 @@ int TLSCtx_free(tls_ctx *ctx) tls_context_release(ctx); tls_context_free(ctx); + TLS_FREE(ctx); + EASY_TLS_DEBUG("TLSCtx free\n"); return TLS_SUCCESS; } @@ -391,7 +393,9 @@ int TLSSession_free(tls_session *session) mbedtls_ssl_free(session->ssl); mbedtls_net_free(&session->net); + TLS_FREE(session->ssl); + TLS_FREE(session); EASY_TLS_DEBUG("TLSSession free\n"); return 0; -- 2.7.4