This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2010-07-28.20:58:22
SpamBayes Score 0.019712856
Marked as misclassified No
Message-id <1280350705.3.0.213499722891.issue9403@psf.upfronthosting.co.za>
In-reply-to
Content
PyObject_DEL() should not be used to destroy an object because it will break the linked list of allocated objects, list used in pydebug mode to detect bugs. cElementTree should use Py_DECREF() instead of PyObject_DEL() to destroy an objects.

Attached patch fixes that:
 * Replace PyObject_Del() by Py_DECREF()
 * Catch element_new_extra() errors
 * parser dealloc: replace Py_DECREF() by Py_XDECREF() because the pointer may be NULL (error in the constructor)
 * set all parser attributes to NULL at the beginning of the constructor to be able to call safetly the destructor
 * element_new(): define tag, text, tail attributes before calling element_new_extra() to be able to call the destructor
 * raise a MemoryError on element_new_extra() failure. element_new() didn't raise any error on element_new_extra() failure. Other functions just forget to catch element_new_extra() error.

See #3299 for the whole story.
History
Date User Action Args
2010-07-28 20:58:25vstinnersetrecipients: + vstinner
2010-07-28 20:58:25vstinnersetmessageid: <1280350705.3.0.213499722891.issue9403@psf.upfronthosting.co.za>
2010-07-28 20:58:24vstinnerlinkissue9403 messages
2010-07-28 20:58:23vstinnercreate