Skip to content

gh-145200: Fix EVP_MAC_CTX leak in hashlib HMAC on init failure#145201

Open
raminfp wants to merge 5 commits intopython:mainfrom
raminfp:fix-gh-145200-hashlib-hmac-ctx-leak
Open

gh-145200: Fix EVP_MAC_CTX leak in hashlib HMAC on init failure#145201
raminfp wants to merge 5 commits intopython:mainfrom
raminfp:fix-gh-145200-hashlib-hmac-ctx-leak

Conversation

@raminfp
Copy link
Contributor

@raminfp raminfp commented Feb 25, 2026

Free the EVP_MAC_CTX (or HMAC_CTX) when EVP_MAC_init() (or HMAC_Init_ex()) fails in hashlib_HMAC_CTX_new_from_digestmod(), preventing a memory leak on every failed call.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants