fix hash hrbg memory leaks

This commit is contained in:
toddouska
2014-12-04 11:24:38 -08:00
parent 7fbf8359e2
commit 53cb50761d
3 changed files with 19 additions and 2 deletions

View File

@@ -1442,7 +1442,7 @@ int PKCS7_EncodeEnvelopedData(PKCS7* pkcs7, byte* output, word32 outputSz)
XMEMCPY(output + idx, encryptedContent, desOutSz);
idx += desOutSz;
#ifdef NO_RC4
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
FreeRng(&rng);
#endif

View File

@@ -4704,6 +4704,10 @@ int ecc_test(void)
ecc_free(&userB);
ecc_free(&userA);
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
FreeRng(&rng);
#endif
return 0;
}
@@ -5267,6 +5271,10 @@ int pkcs7signed_test(void)
free(out);
PKCS7_Free(&msg);
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
FreeRng(&rng);
#endif
if (ret > 0)
return 0;