https://github.com/python/cpython/commit/c19e36cc4eabacaacc359e8b2550b10c2965a31a
commit: c19e36cc4eabacaacc359e8b2550b10c2965a31a
branch: main
author: Bénédikt Tran <[email protected]>
committer: picnixz <[email protected]>
date: 2025-06-09T09:10:32Z
summary:
gh-131316: fix invalid `DECREF` in `_md5.md5.copy()` (#135291)
This amends commit 261633bd3f48607478f50d12d8025cd4bb36f6f4.
files:
M Modules/md5module.c
diff --git a/Modules/md5module.c b/Modules/md5module.c
index 9b5ea2d6e02605..08dbcd2cbce844 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -120,7 +120,7 @@ MD5Type_copy_impl(MD5object *self, PyTypeObject *cls)
newobj->hash_state = Hacl_Hash_MD5_copy(self->hash_state);
LEAVE_HASHLIB(self);
if (newobj->hash_state == NULL) {
- Py_DECREF(self);
+ Py_DECREF(newobj);
return PyErr_NoMemory();
}
return (PyObject *)newobj;
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]