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

This commit is contained in:
Antoine Pitrou 2012-02-15 22:25:27 +01:00
parent c82da813c1
commit dd7e071b23
2 changed files with 16 additions and 9 deletions

View File

@ -93,6 +93,8 @@ Core and Builtins
Library
-------
- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
- Issue #13987: HTMLParser is now able to handle EOFs in the middle of a
construct and malformed start tags.

View File

@ -644,15 +644,20 @@ _create_tuple_for_X509_NAME (X509_NAME *xname)
goto fail1;
}
/* now, there's typically a dangling RDN */
if ((rdn != NULL) && (PyList_Size(rdn) > 0)) {
rdnt = PyList_AsTuple(rdn);
Py_DECREF(rdn);
if (rdnt == NULL)
goto fail0;
retcode = PyList_Append(dn, rdnt);
Py_DECREF(rdnt);
if (retcode < 0)
goto fail0;
if (rdn != NULL) {
if (PyList_GET_SIZE(rdn) > 0) {
rdnt = PyList_AsTuple(rdn);
Py_DECREF(rdn);
if (rdnt == NULL)
goto fail0;
retcode = PyList_Append(dn, rdnt);
Py_DECREF(rdnt);
if (retcode < 0)
goto fail0;
}
else {
Py_DECREF(rdn);
}
}
/* convert list to tuple */