Commit 2f5a163d authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().

parent 1ca93954
......@@ -116,6 +116,8 @@ Core and Builtins
Library
-------
- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
Patch by Suman Saha.
......
......@@ -519,7 +519,8 @@ _create_tuple_for_X509_NAME (X509_NAME *xname)
goto fail1;
}
/* now, there's typically a dangling RDN */
if ((rdn != NULL) && (PyList_Size(rdn) > 0)) {
if (rdn != NULL) {
if (PyList_GET_SIZE(rdn) > 0) {
rdnt = PyList_AsTuple(rdn);
Py_DECREF(rdn);
if (rdnt == NULL)
......@@ -529,6 +530,10 @@ _create_tuple_for_X509_NAME (X509_NAME *xname)
if (retcode < 0)
goto fail0;
}
else {
Py_DECREF(rdn);
}
}
/* convert list to tuple */
rdnt = PyList_AsTuple(dn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment