]> granicus.if.org Git - python/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 5d30b1a5e2ec84ce1026aecdb0746a952f3cc9ee..ec443917c7f750c37161104fb8508898148f625d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -55,6 +55,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 c9c556e83234bfe497483db3d6405bfcd6edeb05..55159d7de15b3adc34844a77587a2209a9034cb7 100644 (file)
@@ -965,7 +965,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;
     }