Memory Leak Fix

1. In `wolfSSL_d2i_DHparams()`, when setting the internal key on a
   WOLFSSL_KEY, set the flag inSet.
2. Not a leak, but in `wolfSSL_EVP_PKEY_set1_DH()`, only allocate one
   buffer to store the flat key. Saves an alloc, memcpy, and free.
This commit is contained in:
John Safranek
2020-04-17 16:31:38 -07:00
parent 61f3783111
commit ccd096e1bb
2 changed files with 4 additions and 15 deletions
+1
View File
@@ -18539,6 +18539,7 @@ WOLFSSL_DH *wolfSSL_d2i_DHparams(WOLFSSL_DH **dh, const unsigned char **pp,
wolfSSL_DH_free(newDH);
return NULL;
}
newDH->inSet = 1;
if (SetDhExternal(newDH) != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("SetDhExternal failed");