Skip to content

Commit 13cc679

Browse files
Issue python#24469: Fixed memory leak caused by int subclasses without overridden
tp_free (e.g. C-inherited Cython classes).
1 parent 0092bc7 commit 13cc679

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 2.7.13?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #24469: Fixed memory leak caused by int subclasses without overridden
14+
tp_free (e.g. C-inherited Cython classes).
15+
1316
- Issue #19398: Extra slash no longer added to sys.path components in case of
1417
empty compile-time PYTHONPATH components.
1518

Objects/intobject.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,6 @@ int_dealloc(PyIntObject *v)
139139
Py_TYPE(v)->tp_free((PyObject *)v);
140140
}
141141

142-
static void
143-
int_free(PyIntObject *v)
144-
{
145-
Py_TYPE(v) = (struct _typeobject *)free_list;
146-
free_list = v;
147-
}
148-
149142
long
150143
PyInt_AsLong(register PyObject *op)
151144
{
@@ -1451,7 +1444,6 @@ PyTypeObject PyInt_Type = {
14511444
0, /* tp_init */
14521445
0, /* tp_alloc */
14531446
int_new, /* tp_new */
1454-
(freefunc)int_free, /* tp_free */
14551447
};
14561448

14571449
int

0 commit comments

Comments
 (0)