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 bu...@apache.org on 2001/07/30 10:50:37 UTC
[Bug 2879] New: - Memory-Leak in DOMString-Class
PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2879
*** shadow/2879 Mon Jul 30 01:50:36 2001
--- shadow/2879.tmp.20083 Mon Jul 30 01:50:36 2001
***************
*** 0 ****
--- 1,64 ----
+ +============================================================================+
+ | Memory-Leak in DOMString-Class |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2879 Product: Xerces-C++ |
+ | Status: NEW Version: 1.5.1 |
+ | Resolution: Platform: All |
+ | Severity: Normal OS/Version: All |
+ | Priority: Other Component: DOM |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-c-dev@xml.apache.org |
+ | Reported By: szorn@aycan.de |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Hy there,
+
+ while testing my application that uses your great Xerces-C++ library I found a
+ really critical Memory-Leak (in my opinion). It is in the class DOMString when I
+ use the transcode() method. You can easily reproduce it with this little
+ program:
+
+
+ #include <iostream.h>
+ #include <util/PlatformUtils.hpp>
+ #include <dom/DOMString.hpp>
+
+ int main(int argc, char *argv[])
+ {
+
+ try
+ {
+ XMLPlatformUtils::Initialize();
+ }
+ catch(const XMLException& toCatch)
+ {
+ cerr << "Error while initializing Xerces-c library!" << endl;
+ exit(1);
+ }
+
+ DOMString TestString = "test";
+
+ for(int i=0 ; i<10000000 ; i++)
+ {
+ TestString.transcode();
+ }
+
+ return(0);
+ }
+
+
+ Memory-Usage increases VERY fast when you start the Program. While debugging the
+ library I found the responsible code.
+ It is this line in the transcode() method:
+
+ char *retP = new char[charsNeeded + 1];
+
+ The variable retP is the Return-Value of the method. The allocated memory is
+ never freed when you do it this way. retP maybe should become a class-member to
+ avoid this.
+
+ I hope, you find a way to fix this bug. Please let me know, what could be done
+ and when the fix is finished.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org