From commits-return-9472-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Sun Nov 02 20:27:04 2008 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 61889 invoked from network); 2 Nov 2008 20:27:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2008 20:27:04 -0000 Received: (qmail 23068 invoked by uid 500); 2 Nov 2008 20:27:10 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 23046 invoked by uid 500); 2 Nov 2008 20:27:10 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 23037 invoked by uid 99); 2 Nov 2008 20:27:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 12:27:10 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 20:26:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 747EB2388879; Sun, 2 Nov 2008 12:26:13 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709920 - /activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp Date: Sun, 02 Nov 2008 20:26:13 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081102202613.747EB2388879@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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() );