Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D3BE10AF2 for ; Wed, 19 Feb 2014 19:23:19 +0000 (UTC) Received: (qmail 90949 invoked by uid 500); 19 Feb 2014 19:23:18 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 90894 invoked by uid 500); 19 Feb 2014 19:23:18 -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 90887 invoked by uid 99); 19 Feb 2014 19:23:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 19:23:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 54F339280EB; Wed, 19 Feb 2014 19:23:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: https://issues.apache.org/jira/browse/AMQCPP-533 Date: Wed, 19 Feb 2014 19:23:18 +0000 (UTC) Repository: activemq-cpp Updated Branches: refs/heads/3.8.x b2c6ec3d8 -> d26d2c9ba https://issues.apache.org/jira/browse/AMQCPP-533 apply patch for memory leak in Stomp when sending BytesMessage Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/d26d2c9b Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/d26d2c9b Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/d26d2c9b Branch: refs/heads/3.8.x Commit: d26d2c9baf40e3dd4b18c1cb83a19eb8777a767d Parents: b2c6ec3 Author: Timothy Bish Authored: Wed Feb 19 14:21:50 2014 -0500 Committer: Timothy Bish Committed: Wed Feb 19 14:23:03 2014 -0500 ---------------------------------------------------------------------- .../src/main/activemq/wireformat/stomp/StompWireFormat.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/d26d2c9b/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp b/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp index 6323196..1423717 100644 --- a/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp +++ b/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp @@ -366,8 +366,12 @@ Pointer StompWireFormat::marshalMessage(const Pointer comma try { Pointer bytesMessage = message.dynamicCast(); - frame->setBody(bytesMessage->getBodyBytes(), bytesMessage->getBodyLength()); + unsigned char* bodyBytes = bytesMessage->getBodyBytes(); + frame->setBody(bodyBytes, bytesMessage->getBodyLength()); frame->setProperty(StompCommandConstants::HEADER_CONTENTLENGTH, Long::toString(bytesMessage->getBodyLength())); + if (bodyBytes) { + delete [] bodyBytes; + } return frame; } catch (ClassCastException& ex) { }