[Python-checkins] r87142 - in python/branches/release27-maint: Modules/_ssl.c
hirokazu.yamamoto
python-checkins at python.org
Thu Dec 9 13:12:42 CET 2010
Author: hirokazu.yamamoto
Date: Thu Dec 9 13:12:42 2010
New Revision: 87142
Log:
Merged revisions 87140 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r87140 | hirokazu.yamamoto | 2010-12-09 19:49:00 +0900 (木, 09 12 2010) | 2 lines
Should call Py_INCREF for Py_None (Modules/_ssl.c: PySSL_cipher)
........
Modified:
python/branches/release27-maint/ (props changed)
python/branches/release27-maint/Modules/_ssl.c
Modified: python/branches/release27-maint/Modules/_ssl.c
==============================================================================
--- python/branches/release27-maint/Modules/_ssl.c (original)
+++ python/branches/release27-maint/Modules/_ssl.c Thu Dec 9 13:12:42 2010
@@ -1046,10 +1046,10 @@
char *cipher_protocol;
if (self->ssl == NULL)
- return Py_None;
+ Py_RETURN_NONE;
current = SSL_get_current_cipher(self->ssl);
if (current == NULL)
- return Py_None;
+ Py_RETURN_NONE;
retval = PyTuple_New(3);
if (retval == NULL)
@@ -1057,6 +1057,7 @@
cipher_name = (char *) SSL_CIPHER_get_name(current);
if (cipher_name == NULL) {
+ Py_INCREF(Py_None);
PyTuple_SET_ITEM(retval, 0, Py_None);
} else {
v = PyString_FromString(cipher_name);
@@ -1066,6 +1067,7 @@
}
cipher_protocol = SSL_CIPHER_get_version(current);
if (cipher_protocol == NULL) {
+ Py_INCREF(Py_None);
PyTuple_SET_ITEM(retval, 1, Py_None);
} else {
v = PyString_FromString(cipher_protocol);
More information about the Python-checkins
mailing list