CVE-2026-33852: Unguided Oldns Clear Memory Leak

Unconditionally clearing the 'oldNs' pointer before freeing a document with 'xmlFreeDoc' leads to a memory leak when parsing XML chunks if the context document is NULL. The namespace objects become orphaned and are not released. To fix this, ensure 'oldNs' is only cleared when a valid parent document exists.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0c
greprules fetch cve-2026-33852-unguided-oldns-clear-memory-leak --engine opengrep

Description

Unconditionally clearing the 'oldNs' pointer before freeing a document with 'xmlFreeDoc' leads to a memory leak when parsing XML chunks if the context document is NULL. The namespace objects become orphaned and are not released. To fix this, ensure 'oldNs' is only cleared when a valid parent document exists.

Detection target

Not provided

Recommended fix

Not provided

False-positive notes

Not provided

Community feedback

Sign in to report false positives, mark this rule useful, or suggest metadata improvements.