changeset: 74964:9ab501b3e22d parent: 74960:ba5b337ecc27 parent: 74963:f3a4c2b34973 user: Antoine Pitrou date: Wed Feb 15 22:28:21 2012 +0100 files: Misc/NEWS Modules/_ssl.c description: Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert(). diff -r ba5b337ecc27 -r 9ab501b3e22d Misc/NEWS --- a/Misc/NEWS Wed Feb 15 22:22:34 2012 +0200 +++ b/Misc/NEWS Wed Feb 15 22:28:21 2012 +0100 @@ -466,6 +466,8 @@ Library ------- +- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert(). + - Issue #13777: Add PF_SYSTEM sockets on OS X. Patch by Michael Goderbauer. diff -r ba5b337ecc27 -r 9ab501b3e22d Modules/_ssl.c --- a/Modules/_ssl.c Wed Feb 15 22:22:34 2012 +0200 +++ b/Modules/_ssl.c Wed Feb 15 22:28:21 2012 +0100 @@ -547,15 +547,20 @@ 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 */

AltStyle によって変換されたページ (->オリジナル) /