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 "Rinil Baxi (JIRA)" <xe...@xml.apache.org> on 2006/08/10 09:31:13 UTC

[jira] Created: (XERCESC-1624) Memory leak on Tandem platform

Memory leak on Tandem platform
------------------------------

                 Key: XERCESC-1624
                 URL: http://issues.apache.org/jira/browse/XERCESC-1624
             Project: Xerces-C++
          Issue Type: Bug
          Components: DOM
    Affects Versions: 2.4.0
         Environment: HP Tandem NonStop Kernel
            Reporter: Rinil Baxi


Xercers DOM API parser->resetDocumentPool() does not release all 
the allocated memory by the DOM parser API parser->parseURI(xmlFile).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESC-1624) Memory leak on Tandem platform

Posted by "Rinil Baxi (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESC-1624?page=comments#action_12427128 ] 
            
Rinil Baxi commented on XERCESC-1624:
-------------------------------------

DOM parser API DOMBuilderImpl::parseURI is invoked with the name of 
the XML file to be parsed as the argument. This API invokes the 
method  XMLPlatformUtils::getFullPath. getFullPath method returns the
the fully qualified path of the file. This methods declares a local
char pointer to hold the current directory name. This char pointer 
is not released before returning from the method. This leads to a
memory leak.

Relevant part of Code:

    char* newSrc = XMLString::transcode(srcPath, fgMemoryManager);

    // Use a local buffer that is big enough for the largest legal path
     char* tmpPath = dirname((char*)newSrc);  < ---- char pointer 
                                              declared not deleted
    if (!tmpPath)

---------------------------------------------------------------------------------------------


Recommended Fix
-----------------------------

    char* newXMLString = (char*) fgMemoryManager->allocate
    (
        (strlen(tmpPath) +1) * sizeof(char)
    );//new char [strlen(tmpPath) +1];
    ArrayJanitor<char> newJanitor(newXMLString, fgMemoryManager);
    strcpy(newXMLString, tmpPath);
        strcat(newXMLString , "/");
    fgMemoryManager->deallocate(newSrc);   ---------> This will deallocate the char pointer declared


> Memory leak on Tandem platform
> ------------------------------
>
>                 Key: XERCESC-1624
>                 URL: http://issues.apache.org/jira/browse/XERCESC-1624
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: 2.4.0
>         Environment: HP Tandem NonStop Kernel
>            Reporter: Rinil Baxi
>
> Xercers DOM API parser->resetDocumentPool() does not release all 
> the allocated memory by the DOM parser API parser->parseURI(xmlFile).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (XERCESC-1624) Memory leak on Tandem platform

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1624?page=all ]

Alberto Massari resolved XERCESC-1624.
--------------------------------------

    Resolution: Fixed

Fixed in the 2.7 branch; the 3.0 has a different codebase

> Memory leak on Tandem platform
> ------------------------------
>
>                 Key: XERCESC-1624
>                 URL: http://issues.apache.org/jira/browse/XERCESC-1624
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: 2.4.0
>         Environment: HP Tandem NonStop Kernel
>            Reporter: Rinil Baxi
>
> Xercers DOM API parser->resetDocumentPool() does not release all 
> the allocated memory by the DOM parser API parser->parseURI(xmlFile).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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