mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
This commit is contained in:
parent
1ca93954e1
commit
2f5a163dfc
2 changed files with 16 additions and 9 deletions
|
|
@ -116,6 +116,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
|
||||||
|
|
||||||
- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
|
- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
|
||||||
Patch by Suman Saha.
|
Patch by Suman Saha.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -519,15 +519,20 @@ _create_tuple_for_X509_NAME (X509_NAME *xname)
|
||||||
goto fail1;
|
goto fail1;
|
||||||
}
|
}
|
||||||
/* now, there's typically a dangling RDN */
|
/* now, there's typically a dangling RDN */
|
||||||
if ((rdn != NULL) && (PyList_Size(rdn) > 0)) {
|
if (rdn != NULL) {
|
||||||
rdnt = PyList_AsTuple(rdn);
|
if (PyList_GET_SIZE(rdn) > 0) {
|
||||||
Py_DECREF(rdn);
|
rdnt = PyList_AsTuple(rdn);
|
||||||
if (rdnt == NULL)
|
Py_DECREF(rdn);
|
||||||
goto fail0;
|
if (rdnt == NULL)
|
||||||
retcode = PyList_Append(dn, rdnt);
|
goto fail0;
|
||||||
Py_DECREF(rdnt);
|
retcode = PyList_Append(dn, rdnt);
|
||||||
if (retcode < 0)
|
Py_DECREF(rdnt);
|
||||||
goto fail0;
|
if (retcode < 0)
|
||||||
|
goto fail0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Py_DECREF(rdn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert list to tuple */
|
/* convert list to tuple */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue