mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128)
This commit is contained in:
parent
e395c4dbe1
commit
d0e8212ed7
2 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,8 @@ init_weakref(PyWeakReference *self, PyObject *ob, PyObject *callback)
|
|||
{
|
||||
self->hash = -1;
|
||||
self->wr_object = ob;
|
||||
self->wr_prev = NULL;
|
||||
self->wr_next = NULL;
|
||||
Py_XINCREF(callback);
|
||||
self->wr_callback = callback;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue