File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -928,17 +928,18 @@ static PyObject *PySSL_cipher (PySSLSocket *self) {
928928 char * cipher_protocol ;
929929
930930 if (self -> ssl == NULL )
931- return Py_None ;
931+ Py_RETURN_NONE ;
932932 current = SSL_get_current_cipher (self -> ssl );
933933 if (current == NULL )
934- return Py_None ;
934+ Py_RETURN_NONE ;
935935
936936 retval = PyTuple_New (3 );
937937 if (retval == NULL )
938938 return NULL ;
939939
940940 cipher_name = (char * ) SSL_CIPHER_get_name (current );
941941 if (cipher_name == NULL ) {
942+ Py_INCREF (Py_None );
942943 PyTuple_SET_ITEM (retval , 0 , Py_None );
943944 } else {
944945 v = PyUnicode_FromString (cipher_name );
@@ -948,6 +949,7 @@ static PyObject *PySSL_cipher (PySSLSocket *self) {
948949 }
949950 cipher_protocol = SSL_CIPHER_get_version (current );
950951 if (cipher_protocol == NULL ) {
952+ Py_INCREF (Py_None );
951953 PyTuple_SET_ITEM (retval , 1 , Py_None );
952954 } else {
953955 v = PyUnicode_FromString (cipher_protocol );
You can’t perform that action at this time.
0 commit comments