]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-127667: fix memory leaks in `hashlib` (#127668)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Mon, 3 Mar 2025 08:20:33 +0000 (09:20 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Mar 2025 08:20:33 +0000 (09:20 +0100)
commit097846502b7f33cb327d512e2a396acf4f4de46e
treed4fb4dd460e36d16247689f5cc7380a535cd46c8
parent7e3b788e8f3dc986bcccb047ddc3f0a7a99bb08c
gh-127667: fix memory leaks in `hashlib` (#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.
Modules/_hashopenssl.c