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 pe...@ca.ibm.com on 2001/07/03 23:45:16 UTC
Re: [Bug 2440] New: - delete on pointer from transcode() failed
What about
delete __[ ]__ str;
Regards,
Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: peiyongz@ca.ibm.com
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088
bugzilla@apache.org on 07/03/2001 04:29:39 PM
Please respond to xerces-c-dev@xml.apache.org
To: xerces-c-dev@xml.apache.org
cc:
Subject: [Bug 2440] New: - delete on pointer from transcode() failed
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: xerces-c-dev@xml.apache.org
|
+ | Reported By: vermakov@hotmail.com
|
+ | 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org