Skip to content

Commit bf83b61

Browse files
committed
post-merge
1 parent a4c5865 commit bf83b61

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Modules/_hashopenssl.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ EVPXOF_digest_impl(EVPobject *self, Py_ssize_t length)
797797
}
798798
if (!EVP_DigestFinalXOF(temp_ctx,
799799
(unsigned char*)PyBytes_AS_STRING(retval),
800-
length)) {
800+
length))
801+
{
801802
goto error;
802803
}
803804

@@ -930,10 +931,7 @@ py_evp_fromname(PyObject *module, const char *digestname, PyObject *data_obj,
930931
module, digestname, usedforsecurity ? Py_ht_evp : Py_ht_evp_nosecurity
931932
);
932933
if (digest == NULL) {
933-
if (data_obj != NULL) {
934-
PyBuffer_Release(&view);
935-
}
936-
return NULL;
934+
goto exit;
937935
}
938936

939937
if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
@@ -982,8 +980,10 @@ py_evp_fromname(PyObject *module, const char *digestname, PyObject *data_obj,
982980
if (data_obj != NULL) {
983981
PyBuffer_Release(&view);
984982
}
985-
assert(digest != NULL);
986-
PY_EVP_MD_free(digest);
983+
if (digest != NULL) {
984+
PY_EVP_MD_free(digest);
985+
}
986+
987987
return (PyObject *)self;
988988
}
989989

@@ -1756,12 +1756,12 @@ _hmac_digest(HMACobject *self, unsigned char *buf, unsigned int len)
17561756
{
17571757
HMAC_CTX *temp_ctx = HMAC_CTX_new();
17581758
if (temp_ctx == NULL) {
1759-
PyErr_NoMemory();
1759+
(void)PyErr_NoMemory();
17601760
return 0;
17611761
}
17621762
if (!locked_HMAC_CTX_copy(temp_ctx, self)) {
17631763
HMAC_CTX_free(temp_ctx);
1764-
_setException(PyExc_ValueError, NULL);
1764+
(void)_setException(PyExc_ValueError, NULL);
17651765
return 0;
17661766
}
17671767
int r = HMAC_Final(temp_ctx, buf, &len);

0 commit comments

Comments
 (0)