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

Not a Bug

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)
XML_Parse (python/dist/src/Modules/expat/xmlparse.c:1427)
xmlparse_Parse (python/dist/src/Modules/pyexpat.c:853)


  • Fred L. Drake, Jr.

    • assigned_to: nobody --> fdrake
    • priority: 5 --> 9
  • Fred L. Drake, Jr.

    • priority: 9 --> 7
  • Fred L. Drake, Jr.

    Logged In: YES

    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

    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
  • Fred L. Drake, Jr.

    Logged In: YES

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

  • Fred L. Drake, Jr.

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

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks