diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-11-14 23:12:18 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-11-14 23:12:18 (GMT) |
commit | f0c9038a369eb846f184d1347a33ebb441d3ab6b (patch) | |
tree | 0b2621d1f46655c45f597ac7cc1aa8d242e82d29 | |
parent | 0d441119f5eb6437f6145e89e0963f75494d8a3f (diff) | |
download | cpython-f0c9038a369eb846f184d1347a33ebb441d3ab6b.zip cpython-f0c9038a369eb846f184d1347a33ebb441d3ab6b.tar.gz cpython-f0c9038a369eb846f184d1347a33ebb441d3ab6b.tar.bz2 |
fix possible memory lea k in _get_aia_uri (closes #25578)
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | Modules/_ssl.c | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -106,6 +106,8 @@ Core and Builtins Library ------- +- Issue #25578: Fix (another) memory leak in SSLSocket.getpeercer(). + - Issue #25590: In the Readline completer, only call getattr() once per attribute. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 23e9be7..064ad01 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -977,7 +977,10 @@ _get_aia_uri(X509 *certificate, int nid) { AUTHORITY_INFO_ACCESS *info; info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL); - if ((info == NULL) || (sk_ACCESS_DESCRIPTION_num(info) == 0)) { + if (info == NULL) + return Py_None; + if (sk_ACCESS_DESCRIPTION_num(info) == 0) { + AUTHORITY_INFO_ACCESS_free(info); return Py_None; } |