mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #27866: Fix refleak in cipher_to_dict()
This commit is contained in:
parent
52d61e485e
commit
410b9887e1
1 changed files with 1 additions and 12 deletions
|
|
@ -1587,12 +1587,6 @@ cipher_to_dict(const SSL_CIPHER *cipher)
|
||||||
int aead, nid;
|
int aead, nid;
|
||||||
const char *skcipher = NULL, *digest = NULL, *kx = NULL, *auth = NULL;
|
const char *skcipher = NULL, *digest = NULL, *kx = NULL, *auth = NULL;
|
||||||
#endif
|
#endif
|
||||||
PyObject *retval;
|
|
||||||
|
|
||||||
retval = PyDict_New();
|
|
||||||
if (retval == NULL) {
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* can be NULL */
|
/* can be NULL */
|
||||||
cipher_name = SSL_CIPHER_get_name(cipher);
|
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;
|
auth = nid != NID_undef ? OBJ_nid2ln(nid) : NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
retval = Py_BuildValue(
|
return Py_BuildValue(
|
||||||
"{sksssssssisi"
|
"{sksssssssisi"
|
||||||
#if OPENSSL_VERSION_1_1
|
#if OPENSSL_VERSION_1_1
|
||||||
"sOssssssss"
|
"sOssssssss"
|
||||||
|
|
@ -1636,11 +1630,6 @@ cipher_to_dict(const SSL_CIPHER *cipher)
|
||||||
"auth", auth
|
"auth", auth
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
return retval;
|
|
||||||
|
|
||||||
error:
|
|
||||||
Py_XDECREF(retval);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue