Hi All,

       Iam trying to run a memory leak checker (Purify) with an XML Processing application linked against Xerces. Iam getting lot of Purify errors while calling transcode() on DOMStrings, even after freeing the pointer returned.

I checked the FAQ and it mentioned that such reports *might* be bogus. Has anybody reported this before ? If this is not a leak , why am I seeing leaks only in transcode() ?

       Appreciate anyone throwing light on this and probably help me figure out a good way to avoid such warnings.

Regards
Ram

a sample code looks like

nodeToStringBuffer(....)
{
..
..
       case DOM_Node::PROCESSING_INSTRUCTION_NODE :
        {
//the next line shows me a leak
            XMLNodeName = dstrXMLNodeName.transcode();
            iretval = SourceBuffer.AppendStringToBuffer((char *)gStartPI);
            iretval = SourceBuffer.AppendStringToBuffer(XMLNodeValue);
            EnsurePtrIsFreed((void **)&XMLNodeName);
        }

}
void EnsurePtrIsFreed(void **ptr)
{
    try
    {
        if (ptr == NULL)
            return;
        if (*ptr != NULL)
        {
            free(*ptr);
            *ptr = NULL;
        }
    }
    catch ( ... )
    {
    }
}
 
 

--
******************************
Ramkumar Iyer
Sr. Software Engineer
Wipro Technologies
ESN  : 6-297-2870
Email: [EMAIL PROTECTED]
******************************
You cannot be what you should be,
so long as you think you are what
you are.
 

Reply via email to