mirror of
https://github.com/python/cpython
synced 2024-09-16 00:17:02 +00:00
bpo-45329: Fix freed memory access in pyexpat.c (GH-28649)
This commit is contained in:
parent
417faa69bd
commit
0742abdc48
|
@ -0,0 +1,2 @@
|
||||||
|
Fix freed memory access in :class:`pyexpat.xmlparser` when building it with an
|
||||||
|
installed expat library <= 2.2.0.
|
|
@ -1204,10 +1204,10 @@ static void
|
||||||
xmlparse_dealloc(xmlparseobject *self)
|
xmlparse_dealloc(xmlparseobject *self)
|
||||||
{
|
{
|
||||||
PyObject_GC_UnTrack(self);
|
PyObject_GC_UnTrack(self);
|
||||||
|
(void)xmlparse_clear(self);
|
||||||
if (self->itself != NULL)
|
if (self->itself != NULL)
|
||||||
XML_ParserFree(self->itself);
|
XML_ParserFree(self->itself);
|
||||||
self->itself = NULL;
|
self->itself = NULL;
|
||||||
(void)xmlparse_clear(self);
|
|
||||||
|
|
||||||
if (self->handlers != NULL) {
|
if (self->handlers != NULL) {
|
||||||
PyMem_Free(self->handlers);
|
PyMem_Free(self->handlers);
|
||||||
|
|
Loading…
Reference in a new issue