gh-140593: Fix a memory leak in function my_ElementDeclHandler of pyexpat (#140602)

Ensure that the memory allocated for the content model
passed to `my_ElementDeclHandler` is freed in all error
paths.
This commit is contained in:
Sebastian Pipping
2025-10-26 14:45:32 +01:00
committed by GitHub
parent 37827c1752
commit e34a5e3304
3 changed files with 21 additions and 1 deletions

View File

@@ -642,7 +642,7 @@ my_ElementDeclHandler(void *userData,
PyObject *modelobj, *nameobj;
if (PyErr_Occurred())
return;
goto finally;
if (flush_character_buffer(self) < 0)
goto finally;