Skip to content

Conversation

@x2018
Copy link
Contributor

@x2018 x2018 commented Nov 9, 2025

cert_store_path is allocated via get_cert_location() after cert_path is allocated.

This PR fixes the potential memory leak of cert_store_path on four (original) error paths.
Overall, three of the four error paths are under the branch if(fInCert || blob) {...) and it is not actually used in the branch, so I just free it at the beginning of the branch along with curlx_unicodefree(cert_path);.

x2018 added 2 commits November 9, 2025 22:20
`cert_store_path` is not be used in (fInCert || blob) branch.
This commit moves the previously added free(cert_store_path) to the front of
the branch, so that we do not need to do it on the subsequent three error
paths under the branch.
@github-actions github-actions bot added TLS Windows Windows-specific labels Nov 9, 2025
@x2018 x2018 changed the title schannel: fix the potental memory leak of cert_store_path schannel: fix potential memory leak of cert_store_path Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants