mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 20:50:49 +02:00
Merge pull request #9922 from Frauschi/f-450
Fix memory leak in error case within RsaMGF1
This commit is contained in:
@@ -985,6 +985,10 @@ static int RsaMGF1(enum wc_HashType hType, byte* seed, word32 seedSz,
|
||||
#endif
|
||||
if (ret != 0) {
|
||||
/* check for if dynamic memory was needed, then free */
|
||||
#ifdef WOLFSSL_SMALL_STACK_CACHE
|
||||
wc_HashFree(hash, hType);
|
||||
XFREE(hash, heap, DYNAMIC_TYPE_DIGEST);
|
||||
#endif
|
||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
|
||||
if (tmpF) {
|
||||
XFREE(tmp, heap, DYNAMIC_TYPE_RSA_BUFFER);
|
||||
|
||||
Reference in New Issue
Block a user