Please don't post HTML to the list!

Your code is broken.  The memory from DOMString::transcode() is allocated
using new [].  It can only be deleted using delete []:

void
foo(const DOMString&  str)
{
    const char*  localStr = str.transcode();

    ...

    delete [] localStr;
}

In addition to this, if you're on a Windows platform, make sure you're
using the appropriate run-time library:

    http://xml.apache.org/xerces-c/faq-build.html#faq-11

Dave



                                                                                       
                                        
                      Ramkumar Iyer                                                    
                                        
                      <ramkumar.iyer@w         To:      [EMAIL PROTECTED]    
                                        
                      ipro.com>                cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                   
                                               Subject: Xerces bogus Memory Leak 
Errors ?                                      
                      06/07/2002 10:03                                                 
                                        
                      AM                                                               
                                        
                      Please respond                                                   
                                        
                      to xerces-c-dev                                                  
                                        
                                                                                       
                                        
                                                                                       
                                        



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









---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to