Skip to content

use xmlFreeNode in xml_document.c to deallocate unparented nodes of all types #1826

@flavorjones

Description

@flavorjones

As @stevecheckoway pointed out in #1784 we might be able to avoid the case statement in dealloc_node_i and let xmlFreeNode take care of it for us.

This change would be a simplification, but I need to spend some time digging into:

  • why we call xmlFreePropList on XML_ATTRIBUTE_NODEs
  • why we reparent most nodes back into the document instead of just freeing them.

Both of these features have been around since 2009 (1aa012a) and I couldn't quickly find a clear reason why. Let's be careful here not to introduce an inadvertent memory leak.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/memorySegfaults, memory leaks, valgrind testing, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions