Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0c9038

Browse files
committed
fix possible memory lea k in _get_aia_uri (closes #25578)
1 parent 0d44111 commit f0c9038

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ Core and Builtins
106106
Library
107107
-------
108108

109+
- Issue #25578: Fix (another) memory leak in SSLSocket.getpeercer().
110+
109111
- Issue #25590: In the Readline completer, only call getattr() once per
110112
attribute.
111113

Modules/_ssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,10 @@ _get_aia_uri(X509 *certificate, int nid) {
977977
AUTHORITY_INFO_ACCESS *info;
978978

979979
info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL);
980-
if ((info == NULL) || (sk_ACCESS_DESCRIPTION_num(info) == 0)) {
980+
if (info == NULL)
981+
return Py_None;
982+
if (sk_ACCESS_DESCRIPTION_num(info) == 0) {
983+
AUTHORITY_INFO_ACCESS_free(info);
981984
return Py_None;
982985
}
983986

0 commit comments

Comments
 (0)