#235 memory leak in xmlparse.c::doProlog()

Not a Bug
closed-rejected
None
3
2003-01-29
2003-01-29
Neal Norwitz
No

As of now, 2003/1/29, there is a memory leak in
xmlparse.c::doProlog() line 3979.

The XML_Content is dynamically allocated, but never
freed in the block. The lifetime of the variable
content is not clear. It is passed to
elementDeclHandler(). Does content need to be dynamic,
or can it be a local (stack) variable? Does
elementDeclHandler() take ownership of content?

I can make the change in Python (which is where this
problem was found from test_minidom).

20 bytes in 1 blocks are definitely lost in loss record
2 of 15
at 0x4015D480: malloc (vg_clientfuncs.c:100)
doProlog (python/dist/src/Modules/expat/xmlparse.c:3979)
prologProcessor
(python/dist/src/Modules/expat/xmlparse.c:3185)
prologInitProcessor
(python/dist/src/Modules/expat/xmlparse.c:3016)
XML_ParseBuffer
(python/dist/src/Modules/expat/xmlparse.c:1439)
XML_Parse (python/dist/src/Modules/expat/xmlparse.c:1427)
xmlparse_Parse (python/dist/src/Modules/pyexpat.c:853)

Discussion

    • assigned_to: nobody --> fdrake
    • priority: 5 --> 9
     
    • priority: 9 --> 7
     
  • Logged In: YES
    user_id=3066

    Oops, didn't mean to set the priority *that* high; it's a leak,
    not a segfault!

     
  • Karl Waclawek
    Karl Waclawek
    2003-01-29

    Logged In: YES
    user_id=290026

    The content model needs to be freed by the application,
    which is documented in reference.html.

    We added a new API call in the current release,
    XML_FreeContentModel, to make it easier for
    non-C languages to free the content model
    passed to the elemenDeclHandler.

     
  • Karl Waclawek
    Karl Waclawek
    2003-01-29

    • milestone: --> Not a Bug
    • priority: 7 --> 9
    • status: open --> open-rejected
     
  • Karl Waclawek
    Karl Waclawek
    2003-01-29

    • priority: 9 --> 3
     
  • Logged In: YES
    user_id=3066

    Sheesh, that'll teach me to read a report too quickly! Dang
    crazy day job...

     
    • status: open-rejected --> closed-rejected