Skip to content

Fix Memory Leaks #3

@Zelmoghazy

Description

@Zelmoghazy
void XML_free(XMLNode *node)
{
    for (int i = 0; i < node->children.size; i++) {
        XML_free(node->children.data[i]);
    }
    free(node->children.data);
    XMLNode_free(node);
}

The XMLDocument_free function doesnt really free the XML tree it only frees the root node, I think this frees the entire tree tested with valgrind although relying on recursion is not a good idea an iterative version is more complicated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions