You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2003/10/28 09:23:41 UTC

DO NOT REPLY [Bug 24173] New: - Memory leak in DOMElementImpl

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24173>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24173

Memory leak in DOMElementImpl

           Summary: Memory leak in DOMElementImpl
           Product: Xerces-C++
           Version: 2.3.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DOM
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: sminchenko@cboss.ru


Code like this has a memory leak:

while(1)
{
 // pDoc - DOM document
 DOMNode* pNode = pDoc->createElement(pxszName); 
 pNode->release();
}

After first release() call 'pNode' pointer was pushed into pool, but DOMElement 
(DOMElementImpl of course) object have some members dynamically allocated (it's 
DOMAttrMapImpl    *fAttributes; DOMAttrMapImpl    *fDefaultAttributes;).
In next createElement() call 'pNode' was assigned pointer from pool and 
DOMElementImpl constructer was called next. 
In constructor of DOMElementImpl the memory for appointed earlier members 
(fAttributes and fDefaultAttributes) was again allocated but not freed earlier. 
It's memory leak.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org