HomeClusterLabs Projects

Low: libcrmcommon: Fix memory leak in pcmk__build_schema_xml_node()

Description

Low: libcrmcommon: Fix memory leak in pcmk__build_schema_xml_node()

xmlAddChild(parent, schema_node) unlinks schema_ndoe from its document
and adds it to parent's document. schema_node's original document is
never freed.

It makes more sense to add it as a child of parent in the first place.
Then it belongs to parent's document, and we don't create a temporary
document that we'll immediately discard.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on May 7 2024, 12:06 AM
Parents
rP49ed471cf522: Low: libcrmcommon: Fix memory leak in ipc_proxy_dispatch()
Branches
Unknown
Tags
Unknown