Mercurial > cpython-lru_cache-weakref
diff Modules/_ssl.c @ 66802:8d4feedeaaed
Should call Py_INCREF for Py_None (Modules/_ssl.c: PySSL_cipher)
| author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> |
|---|---|
| date | Thu, 09 Dec 2010 10:49:00 +0000 |
| parents | 3d9a86b8cc98 |
| children | 852186e5ae2a |
line wrap: on
line diff
--- a/Modules/_ssl.c Wed Dec 08 23:31:48 2010 +0000 +++ b/Modules/_ssl.c Thu Dec 09 10:49:00 2010 +0000 @@ -928,10 +928,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) @@ -939,6 +939,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 = PyUnicode_FromString(cipher_name); @@ -948,6 +949,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 = PyUnicode_FromString(cipher_protocol);
