CVE-2026-33856: Xml Document Oldns Memory Leak

Unconditionally assigning NULL to a document's oldNs pointer before freeing it with xmlFreeDoc results in a memory leak if the parser was running without an associated document object. Guard the assignment with a check to ensure the document context is valid.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C
greprules fetch cve-2026-33856-xml-document-oldns-memory-leak --engine opengrep

Description

Unconditionally assigning NULL to a document's oldNs pointer before freeing it with xmlFreeDoc results in a memory leak if the parser was running without an associated document object. Guard the assignment with a check to ensure the document context is valid.