diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-12 10:00:23 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-12 10:00:23 (GMT) |
commit | 410b9887e14f6b15c00c10e57537297c3abe45dd (patch) | |
tree | 31abaad3470401651776ea1ed04c29f6037c6fc0 | |
parent | 52d61e485eeebcd3cc9ebdf0c762d100fc2916dc (diff) | |
download | cpython-410b9887e14f6b15c00c10e57537297c3abe45dd.zip cpython-410b9887e14f6b15c00c10e57537297c3abe45dd.tar.gz cpython-410b9887e14f6b15c00c10e57537297c3abe45dd.tar.bz2 |
Issue #27866: Fix refleak in cipher_to_dict()
-rw-r--r-- | Modules/_ssl.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 736fc1d..b32d1c1 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1587,12 +1587,6 @@ cipher_to_dict(const SSL_CIPHER *cipher) int aead, nid; const char *skcipher = NULL, *digest = NULL, *kx = NULL, *auth = NULL; #endif - PyObject *retval; - - retval = PyDict_New(); - if (retval == NULL) { - goto error; - } /* can be NULL */ cipher_name = SSL_CIPHER_get_name(cipher); @@ -1616,7 +1610,7 @@ cipher_to_dict(const SSL_CIPHER *cipher) auth = nid != NID_undef ? OBJ_nid2ln(nid) : NULL; #endif - retval = Py_BuildValue( + return Py_BuildValue( "{sksssssssisi" #if OPENSSL_VERSION_1_1 "sOssssssss" @@ -1636,11 +1630,6 @@ cipher_to_dict(const SSL_CIPHER *cipher) "auth", auth #endif ); - return retval; - - error: - Py_XDECREF(retval); - return NULL; } #endif |