]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-127667: fix memory leaks in `hashlib` (GH-127668) (#130784)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Mon, 3 Mar 2025 11:01:01 +0000 (12:01 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Mar 2025 11:01:01 +0000 (11:01 +0000)
commit9643ce9019c9f01a0e5d773d3abddb79471fa19a
tree4ef553d5967ae25f56b8a504e489aa324d831d34
parent36e696738bbdc17c96c0a98a923c1dd8c1b46f25
[3.13] gh-127667: fix memory leaks in `hashlib` (GH-127668) (#130784)

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