You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Irving Reid <ir...@nevex.com> on 2000/03/07 05:52:58 UTC

Re: memory leaks? (C++, twice in the same day...)

>  I have a memory leak.  I'm not sure yet if it's in the library, or my faulty use of 
>  it.
...
>   char *foo = str.transcode();

transcode() allocates space for the char* using new[]; the caller is 
responsible for delete[]ing it.

This isn't clearly documented; the description of transcode() says that 
it returns a copy of the string, but it doesn't explicitly say that the 
caller must delete[].

 - irving -