From e5e801ca5d36387f5ce94bbe15b8cc3cd6858cd3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 16 Jan 2016 00:04:12 +0100 Subject: [PATCH] polarssl: fix memory leak Signed-off-by: Felix Fietkau --- ustream-polarssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ustream-polarssl.c b/ustream-polarssl.c index 9ddf931..9208e6a 100644 --- a/ustream-polarssl.c +++ b/ustream-polarssl.c @@ -140,6 +140,7 @@ __hidden int __ustream_ssl_set_key_file(struct ustream_ssl_ctx *ctx, const char __hidden void __ustream_ssl_context_free(struct ustream_ssl_ctx *ctx) { pk_free(&ctx->key); + x509_crt_free(&ctx->ca_cert); x509_crt_free(&ctx->cert); free(ctx); } @@ -317,7 +318,7 @@ __hidden void *__ustream_ssl_session_new(struct ustream_ssl_ctx *ctx) ssl_set_ca_chain(ssl, ctx->cert.next, NULL, NULL); ssl_set_own_cert(ssl, &ctx->cert, &ctx->key); } else { - ssl_set_ca_chain(ssl, &ctx->cert, NULL, NULL); + ssl_set_ca_chain(ssl, &ctx->ca_cert, NULL, NULL); } ssl_session_reset(ssl); -- 2.25.1