void Element::updateNamedItemRegistration(const AtomicString& oldName, const AtomicString& newName)
{
    if (!document()->isHTMLDocument())
        return;

    if (!oldName.isEmpty())
        toHTMLDocument(document())->removeNamedItem(oldName);

    if (!newName.isEmpty())
        toHTMLDocument(document())->addNamedItem(newName);
}

This vulnerability category highlights issues in resource management where failures to properly release memory, file handles, or other resources can degrade system performance or enable denial-of-service conditions.