-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-29738: Fix memory leak in _get_crl_dp #526
Conversation
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Use `sk_DIST_POINT_pop_free` instead of `sk_DIST_POINT_free` since the latter doesn't free the individual elements of the stack * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow these steps to rectify the issue:
Thanks again to your contribution and we look forward to looking at it! |
@olivielpeau, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tiran, @Yhg1s, @loewis, @serhiy-storchaka and @Haypo to be potential reviewers. |
@the-knights-who-say-ni : CLA signed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct to me.
I can't remember the rules for merging and backports, so I'm hoping another core dev will actually land :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL.
Modules/_ssl.c
Outdated
#if OPENSSL_VERSION_NUMBER < 0x10001000L | ||
sk_DIST_POINT_free(dps); | ||
#endif | ||
sk_DIST_POINT_pop_free(dps, DIST_POINT_free); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRL_DIST_POINTS_free(dps);
Addresses PR review. CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL.
@tiran Thanks for the review! I've addressed your comment, let me know if this looks good now |
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL. (cherry picked from commit 2849cc3)
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL. (cherry picked from commit 2849cc3)
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL. (cherry picked from commit 2849cc3)
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL. (cherry picked from commit 2849cc3)
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL. (cherry picked from commit 2849cc3)
* Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL. (cherry picked from commit 2849cc3)
Thanks @olivielpeau and congrats for your first contribution to CPython 🎉 |
dps
, sincedps
is now allocated forall versions of OpenSSL
sk_DIST_POINT_pop_free
instead ofsk_DIST_POINT_free
sincethe latter doesn't free the individual elements of the stack
x509_check_ca
since it was only used to cachethe
crldp
field of the certificate