diff options
-rw-r--r-- | Modules/_ssl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index d4e550e..73a76bb 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1047,10 +1047,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) @@ -1058,6 +1058,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 = PyUnicode_FromString(cipher_name); @@ -1067,6 +1068,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 = PyUnicode_FromString(cipher_protocol); |