Skip to content

Commit 70dad95

Browse files
authored
Merge pull request #10776 from julek-wolfssl/fix-sha512-w-cache-free-type
sha512: free SHA-512/384 W cache with its allocated memory type
2 parents 1044418 + dbd495d commit 70dad95

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/sha512.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ void wc_Sha512Free(wc_Sha512* sha512)
23062306
#ifdef WOLFSSL_SMALL_STACK_CACHE
23072307
if (sha512->W != NULL) {
23082308
ForceZero(sha512->W, (sizeof(word64) * 16) + WC_SHA512_BLOCK_SIZE);
2309-
XFREE(sha512->W, sha512->heap, DYNAMIC_TYPE_TMP_BUFFER);
2309+
XFREE(sha512->W, sha512->heap, DYNAMIC_TYPE_DIGEST);
23102310
sha512->W = NULL;
23112311
}
23122312
#endif
@@ -2779,7 +2779,7 @@ void wc_Sha384Free(wc_Sha384* sha384)
27792779
#ifdef WOLFSSL_SMALL_STACK_CACHE
27802780
if (sha384->W != NULL) {
27812781
ForceZero(sha384->W, (sizeof(word64) * 16) + WC_SHA512_BLOCK_SIZE);
2782-
XFREE(sha384->W, sha384->heap, DYNAMIC_TYPE_TMP_BUFFER);
2782+
XFREE(sha384->W, sha384->heap, DYNAMIC_TYPE_DIGEST);
27832783
sha384->W = NULL;
27842784
}
27852785
#endif

0 commit comments

Comments
 (0)