From 60254c9ecbb36894afcd0779683e6574f6adf34f Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 18 Nov 2020 15:40:51 +0000 Subject: [PATCH] Fix bridge memory leak on exit. --- src/context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/context.c b/src/context.c index 32ceca5b..12196b97 100644 --- a/src/context.c +++ b/src/context.c @@ -135,6 +135,16 @@ void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool d mosquitto__free(context->bridge->remote_password); } context->bridge->remote_password = NULL; +#ifdef WITH_TLS + if(context->ssl){ + SSL_free(context->ssl); + context->ssl = NULL; + } + if(context->ssl_ctx){ + SSL_CTX_free(context->ssl_ctx); + context->ssl_ctx = NULL; + } +#endif } #endif