activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r709920 - /activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp
Date Sun, 02 Nov 2008 20:26:13 GMT
Author: tabish
Date: Sun Nov  2 12:26:12 2008
New Revision: 709920

URL: http://svn.apache.org/viewvc?rev=709920&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-200

Fix possible memory leak

Modified:
    activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp

Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp?rev=709920&r1=709919&r2=709920&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp Sun Nov  2
12:26:12 2008
@@ -188,9 +188,9 @@
 
         // copy from the current pos to the beginning all the remaining bytes
         // the set pos to the
-        memcpy( this->array() + offset,
-                this->array() + offset + this->position(),
-                this->remaining() );
+        for( std::size_t ix = 0; ix < this->remaining(); ++ix ) {
+            this->put( ix, this->get( this->position() + ix ) );
+        }
 
         this->position( this->limit() - this->position() );
         this->limit( this->capacity() );



Mime
View raw message