Skip to content

Commit 960aa73

Browse files
committed
fix memory leak
1 parent 379cbef commit 960aa73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/hmacmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ _hmac_compute_digest_impl(PyObject *module, PyObject *key, PyObject *msg,
517517
"key length exceeds UINT32_MAX"); \
518518
return NULL; \
519519
} \
520-
GET_BUFFER_VIEW_OR_ERROUT((MSG), &msgview); \
520+
GET_BUFFER_VIEW_OR_ERROR( \
521+
(MSG), &msgview, \
522+
PyBuffer_Release(&keyview); return NULL \
523+
); \
521524
if (!has_uint32_t_buffer_length(&msgview)) { \
522525
PyBuffer_Release(&msgview); \
523526
PyBuffer_Release(&keyview); \

0 commit comments

Comments
 (0)