From c9a4e9d56b81853c800347223edc2bc58d233097 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 13 Jul 2012 16:52:39 -0700 Subject: [PATCH] fix DHE client side leak --- src/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 9e5362603..9b25d09b8 100644 --- a/src/internal.c +++ b/src/internal.c @@ -942,7 +942,7 @@ void SSL_ResourceFree(CYASSL* ssl) XFREE(ssl->buffers.serverDH_Priv.buffer, ssl->heap, DYNAMIC_TYPE_DH); XFREE(ssl->buffers.serverDH_Pub.buffer, ssl->heap, DYNAMIC_TYPE_DH); /* parameters (p,g) may be owned by ctx */ - if (ssl->buffers.weOwnDH) { + if (ssl->buffers.weOwnDH || ssl->options.side == CLIENT_END) { XFREE(ssl->buffers.serverDH_G.buffer, ssl->heap, DYNAMIC_TYPE_DH); XFREE(ssl->buffers.serverDH_P.buffer, ssl->heap, DYNAMIC_TYPE_DH); }