Skip to content

Commit 0742abd

Browse files
authored
bpo-45329: Fix freed memory access in pyexpat.c (GH-28649)
1 parent 417faa6 commit 0742abd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix freed memory access in :class:`pyexpat.xmlparser` when building it with an
2+
installed expat library <= 2.2.0.

Modules/pyexpat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,10 +1204,10 @@ static void
12041204
xmlparse_dealloc(xmlparseobject *self)
12051205
{
12061206
PyObject_GC_UnTrack(self);
1207+
(void)xmlparse_clear(self);
12071208
if (self->itself != NULL)
12081209
XML_ParserFree(self->itself);
12091210
self->itself = NULL;
1210-
(void)xmlparse_clear(self);
12111211

12121212
if (self->handlers != NULL) {
12131213
PyMem_Free(self->handlers);

0 commit comments

Comments
 (0)