You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/11/02 23:08:59 UTC

svn commit: r709953 - /activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp

Author: tabish
Date: Sun Nov  2 14:08:59 2008
New Revision: 709953

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

Fix possible memory leaks and resolving Valgrind warnings.

Modified:
    activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp

Modified: activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp?rev=709953&r1=709952&r2=709953&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp Sun Nov  2 14:08:59 2008
@@ -460,6 +460,13 @@
     unsigned char* array = new unsigned char[testBuffer1->capacity()];
     unsigned char* array2 = new unsigned char[testBuffer1->capacity() + 1];
 
+    for( std::size_t ix = 0; ix < testBuffer1->capacity(); ++ix ){
+        array[ix] = 0;
+    }
+    for( std::size_t ix = 0; ix < testBuffer1->capacity()+1; ++ix ){
+        array2[ix] = 0;
+    }
+
     ByteBuffer* readOnly = testBuffer1->asReadOnlyBuffer();
     readOnly->clear();
     CPPUNIT_ASSERT_THROW_MESSAGE(