]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix possible memory lea k in _get_aia_uri (closes #25578)
authorBenjamin Peterson <benjamin@python.org>
Sat, 14 Nov 2015 23:12:18 +0000 (15:12 -0800)
committerBenjamin Peterson <benjamin@python.org>
Sat, 14 Nov 2015 23:12:18 +0000 (15:12 -0800)
Misc/NEWS
Modules/_ssl.c

index 1390642451bdd065714b02cae11f4e1731911b08..881f0351e83025dc9e028e3404d3368884afe06a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.
 
index 23e9be767cd10202f1ada8a9f81a167442fca7d8..064ad01dec8b5117793ef69909905f7c25143f18 100644 (file)
@@ -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;
     }