[Python-checkins] cpython (3.4): fix possible memory lea k in _get_aia_uri (closes #25578)

benjamin.peterson python-checkins at python.org
Sat Nov 14 18:15:14 EST 2015


https://hg.python.org/cpython/rev/bddc5491d0fb
changeset:   99142:bddc5491d0fb
branch:      3.4
parent:      99135:73da4fd7542b
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat Nov 14 15:12:18 2015 -0800
summary:
  fix possible memory lea k in _get_aia_uri (closes #25578)

files:
  Misc/NEWS      |  2 ++
  Modules/_ssl.c |  5 ++++-
  2 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -106,6 +106,8 @@
 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
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -977,7 +977,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;
     }
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list