bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)

This commit is contained in:
Oren Milman 2018-02-13 12:28:33 +02:00 committed by INADA Naoki
parent aec7532ed3
commit d019bc8319
13 changed files with 105 additions and 19 deletions

View file

@ -369,8 +369,8 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
return -1;
}
self->name = name_obj;
Py_INCREF(self->name);
Py_INCREF(name_obj);
Py_XSETREF(self->name, name_obj);
if (data_obj) {
if (view.len >= HASHLIB_GIL_MINSIZE) {