changeset: 99140:79abea02a569 branch: 2.7 parent: 99138:8e472cc258ec user: Benjamin Peterson date: Sat Nov 14 15:12:18 2015 -0800 files: Misc/NEWS Modules/_ssl.c description: fix possible memory lea k in _get_aia_uri (closes #25578) diff -r 8e472cc258ec -r 79abea02a569 Misc/NEWS --- a/Misc/NEWS Sat Nov 14 15:14:29 2015 +0200 +++ b/Misc/NEWS Sat Nov 14 15:12:18 2015 -0800 @@ -55,6 +55,8 @@ Library ------- +- Issue #25578: Fix (another) memory leak in SSLSocket.getpeercer(). + - Issue #25590: In the Readline completer, only call getattr() once per attribute. diff -r 8e472cc258ec -r 79abea02a569 Modules/_ssl.c --- a/Modules/_ssl.c Sat Nov 14 15:14:29 2015 +0200 +++ b/Modules/_ssl.c Sat Nov 14 15:12:18 2015 -0800 @@ -965,7 +965,10 @@ 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; }