|Subject:||Calling xmlParseBalancedChunkMemory with NULL doc leaks memory|
_parse_xml_chunk calls domReadWellBalancedString with a NULL document which is then passed to xmlParseBalancedChunkMemory. This leads to a memory leak when parsing namespaces. There's no way to fix this on the libxml2 side. I think _parse_xml_chunk should pass the newly created fragment as document.