diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2007-11-15 19:16:08 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2007-11-15 19:16:08 (GMT) |
commit | a1e9ec4e5515ef60cd1468832e98ba77c9ce29cb (patch) | |
tree | 9767ce674312d3f2d4c8409771d15c097e9d9bf5 /Objects | |
parent | a041ba56fb208e86a7e1dcc6f1449c4741bd0683 (diff) | |
download | cpython-a1e9ec4e5515ef60cd1468832e98ba77c9ce29cb.zip cpython-a1e9ec4e5515ef60cd1468832e98ba77c9ce29cb.tar.gz cpython-a1e9ec4e5515ef60cd1468832e98ba77c9ce29cb.tar.bz2 |
Correct a memory leak: the range() object was not properly freed.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/object.c | 3 | ||||
-rw-r--r-- | Objects/rangeobject.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index df93a19..fa5eb4d 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1509,6 +1509,9 @@ _Py_ReadyTypes(void) if (PyType_Ready(&PyStdPrinter_Type) < 0) Py_FatalError("Can't initialize StdPrinter"); + + if (PyType_Ready(&PyRange_Type) < 0) + Py_FatalError("Can't initialize 'range'"); } diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 3a08ccd..e159feb 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -107,6 +107,7 @@ range_dealloc(rangeobject *r) Py_DECREF(r->start); Py_DECREF(r->stop); Py_DECREF(r->step); + Py_Type(r)->tp_free(r); } /* Return number of items in range (lo, hi, step), when arguments are |