(original) (raw)
changeset: 105396:fd0842f34602 branch: 2.7 parent: 105371:59bd48afa1bc user: Serhiy Storchaka storchaka@gmail.com date: Tue Nov 29 20:49:14 2016 +0200 files: Misc/NEWS Objects/intobject.c description: Issue #24469: Fixed memory leak caused by int subclasses without overridden tp_free (e.g. C-inherited Cython classes). diff -r 59bd48afa1bc -r fd0842f34602 Misc/NEWS --- a/Misc/NEWS Sat Nov 26 13:43:39 2016 +0200 +++ b/Misc/NEWS Tue Nov 29 20:49:14 2016 +0200 @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #24469: Fixed memory leak caused by int subclasses without overridden + tp_free (e.g. C-inherited Cython classes). + - Issue #19398: Extra slash no longer added to sys.path components in case of empty compile-time PYTHONPATH components. diff -r 59bd48afa1bc -r fd0842f34602 Objects/intobject.c --- a/Objects/intobject.c Sat Nov 26 13:43:39 2016 +0200 +++ b/Objects/intobject.c Tue Nov 29 20:49:14 2016 +0200 @@ -139,13 +139,6 @@ Py_TYPE(v)->tp_free((PyObject *)v); } -static void -int_free(PyIntObject *v) -{ - Py_TYPE(v) = (struct _typeobject *)free_list; - free_list = v; -} - long PyInt_AsLong(register PyObject *op) { @@ -1451,7 +1444,6 @@ 0, /* tp_init */ 0, /* tp_alloc */ int_new, /* tp_new */ - (freefunc)int_free, /* tp_free */ }; int /storchaka@gmail.com