http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2440 *** shadow/2440 Tue Jul 3 13:29:39 2001 --- shadow/2440.tmp.10932 Tue Jul 3 13:29:39 2001 *************** *** 0 **** --- 1,37 ---- + +============================================================================+ + | delete on pointer from transcode() failed | + +----------------------------------------------------------------------------+ + | Bug #: 2440 Product: Xerces-C | + | Status: NEW Version: 1.4 | + | Resolution: Platform: PC | + | Severity: Major OS/Version: Windows 9x | + | Priority: Other Component: DOM | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + I have DOM_Node object and I'm getting value of node: + DOMString value = DOM_Node::getNodeValue(); + + Then, I'm getting pointer to a newly allocated buffer of char elements: + char* str = value.transcode(); + + Then, I'm going to delete that allocated area: + delete str; // DAMAGE before free block + + What do I do wrong? I was looking into your code in DOMPrint.cpp and found this + piece: + ostream& operator<< (ostream& target, const DOMString& s) + { + char *p = s.transcode(); + target << p; + delete [] p; + return target; + } + Looks like the same! But something I'm overlooking... Because of that my + program has memory leaks. Could you please explain me my mistake ASAP. It's + critical for my project. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
