]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-127667: fix memory leaks in `hashlib` (GH-127668) (#130783)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Mon, 3 Mar 2025 10:44:42 +0000 (11:44 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Mar 2025 10:44:42 +0000 (10:44 +0000)
commitd25da899535f752be251bee8453b2c6942befaea
tree3d89c73feb0bbcc37296b73893030995784a9c64
parenta22cfd42442f042f813e2a4c373230fbb8d59db9
[3.12] gh-127667: fix memory leaks in `hashlib` (GH-127668) (#130783)

gh-127667: fix memory leaks in `hashlib` (GH-127668)

- Correctly handle `NULL` values returned by `EVP_MD_CTX_md`.
- Correctly free resources in error branches.
- Consistently suppress `_setException()` return value when needed.
- Collapse `_setException() + return NULL` into a single statement.

(cherry-picked from commit 097846502b7f33cb327d512e2a396acf4f4de46e)
Modules/_hashopenssl.c