Skip to content

Commit

Permalink
Resolve hash new leak due to improper heap hint check.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Sep 25, 2024
1 parent 85296c6 commit 9bf84a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wolfcrypt/src/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,8 +1146,9 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type)
ret = BAD_FUNC_ARG;
};

if (isAllocated && heap)
if (isAllocated) {
XFREE(hash, heap, DYNAMIC_TYPE_HASHES);
}

return ret;
}
Expand Down

0 comments on commit 9bf84a2

Please sign in to comment.