summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-12-09 12:12:42 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-12-09 12:12:42 (GMT)
commita9b1689a8978e4419e01cedabd685c0c4c4f2c4a (patch)
treeb6c0920c6f64934b3c3d8f54fc3dcb8ace860866 /Modules/_ssl.c
parent59734be36c891bbebc1e547e36997b0dc11d76fb (diff)
downloadcpython-a9b1689a8978e4419e01cedabd685c0c4c4f2c4a.zip
cpython-a9b1689a8978e4419e01cedabd685c0c4c4f2c4a.tar.gz
cpython-a9b1689a8978e4419e01cedabd685c0c4c4f2c4a.tar.bz2
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) ........
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 5595c15..6ed0f4f 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1046,10 +1046,10 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
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 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
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 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
}
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);