Commit f2780cce authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Correct a memory leak: the range() object was not properly freed.

parent 9807c533
...@@ -1509,6 +1509,9 @@ _Py_ReadyTypes(void) ...@@ -1509,6 +1509,9 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyStdPrinter_Type) < 0) if (PyType_Ready(&PyStdPrinter_Type) < 0)
Py_FatalError("Can't initialize StdPrinter"); Py_FatalError("Can't initialize StdPrinter");
if (PyType_Ready(&PyRange_Type) < 0)
Py_FatalError("Can't initialize 'range'");
} }
......
...@@ -107,6 +107,7 @@ range_dealloc(rangeobject *r) ...@@ -107,6 +107,7 @@ range_dealloc(rangeobject *r)
Py_DECREF(r->start); Py_DECREF(r->start);
Py_DECREF(r->stop); Py_DECREF(r->stop);
Py_DECREF(r->step); Py_DECREF(r->step);
Py_Type(r)->tp_free(r);
} }
/* Return number of items in range (lo, hi, step), when arguments are /* Return number of items in range (lo, hi, step), when arguments are
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment