From 86bf50ea70f5d9f3c7306241a39b0d810d84f0c0 Mon Sep 17 00:00:00 2001 From: Nickolas Lapp Date: Mon, 10 Oct 2016 16:21:30 -0600 Subject: [PATCH] Ensure dh->q is nulled on init and free --- src/ssl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index 8c1dab759..01bd455fd 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -13964,6 +13964,7 @@ static void InitwolfSSL_DH(WOLFSSL_DH* dh) if (dh) { dh->p = NULL; dh->g = NULL; + dh->q = NULL; dh->pub_key = NULL; dh->priv_key = NULL; dh->internal = NULL; @@ -14016,6 +14017,7 @@ void wolfSSL_DH_free(WOLFSSL_DH* dh) wolfSSL_BN_free(dh->pub_key); wolfSSL_BN_free(dh->g); wolfSSL_BN_free(dh->p); + wolfSSL_BN_free(dh->q); InitwolfSSL_DH(dh); /* set back to NULLs for safety */ XFREE(dh, NULL, DYNAMIC_TYPE_DH);