cpython: 9ab501b3e22d (original) (raw)
Mercurial > cpython
changeset 74964:9ab501b3e22d
Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert(). [#13014]
Antoine Pitrou solipsis@pitrou.net | |
---|---|
date | Wed, 15 Feb 2012 22:28:21 +0100 |
parents | ba5b337ecc27(current diff)f3a4c2b34973(diff) |
children | e9d01c5c92ed |
files | Misc/NEWS Modules/_ssl.c |
diffstat | 2 files changed, 16 insertions(+), 9 deletions(-)[+] [-] Misc/NEWS 2 Modules/_ssl.c 23 |
line wrap: on
line diff
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -466,6 +466,8 @@ Core and Builtins Library ------- +- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert(). +
--- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -547,15 +547,20 @@ static PyObject goto fail1; } / now, there's typically a dangling RDN */
- if ((rdn != NULL) && (PyList_Size(rdn) > 0)) {
rdnt = PyList_AsTuple(rdn);[](#l2.8)
Py_DECREF(rdn);[](#l2.9)
if (rdnt == NULL)[](#l2.10)
goto fail0;[](#l2.11)
retcode = PyList_Append(dn, rdnt);[](#l2.12)
Py_DECREF(rdnt);[](#l2.13)
if (retcode < 0)[](#l2.14)
goto fail0;[](#l2.15)
- if (rdn != NULL) {
if (PyList_GET_SIZE(rdn) > 0) {[](#l2.17)
rdnt = PyList_AsTuple(rdn);[](#l2.18)
Py_DECREF(rdn);[](#l2.19)
if (rdnt == NULL)[](#l2.20)
goto fail0;[](#l2.21)
retcode = PyList_Append(dn, rdnt);[](#l2.22)
Py_DECREF(rdnt);[](#l2.23)
if (retcode < 0)[](#l2.24)
goto fail0;[](#l2.25)
}[](#l2.26)
else {[](#l2.27)
Py_DECREF(rdn);[](#l2.28)
} /* convert list to tuple */}[](#l2.29)