fix possible memory lea k in _get_aia_uri (closes #25578)
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 @@
     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;
     }