Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 67119 invoked from network); 25 Aug 2005 03:47:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Aug 2005 03:47:25 -0000 Received: (qmail 28988 invoked by uid 500); 25 Aug 2005 03:47:19 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 28840 invoked by uid 500); 25 Aug 2005 03:47:18 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 28287 invoked by uid 99); 25 Aug 2005 03:47:12 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Aug 2005 20:47:09 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 71FF712C for ; Thu, 25 Aug 2005 05:47:08 +0200 (CEST) Message-ID: <72574255.1124941628335.JavaMail.jira@ajax.apache.org> Date: Thu, 25 Aug 2005 05:47:08 +0200 (CEST) From: "Samisa Abeysinghe (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Updated: (AXISCPP-808) possible memory leak in the AxisChar* Double::serialize(const xsd__double* value) function In-Reply-To: <1332827675.1124845508978.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXISCPP-808?page=all ] Samisa Abeysinghe updated AXISCPP-808: -------------------------------------- Component: XSD Types Version: current (nightly) > possible memory leak in the AxisChar* Double::serialize(const xsd__double* value) function > ------------------------------------------------------------------------------------------ > > Key: AXISCPP-808 > URL: http://issues.apache.org/jira/browse/AXISCPP-808 > Project: Axis-C++ > Type: Bug > Components: XSD Types > Versions: current (nightly) > Reporter: Denis Linine > Priority: Trivial > > Hi > Here is the code from the Double.cpp file. > AxisChar* Double::serialize(const xsd__double* value) throw (AxisSoapException) > { > MinInclusive* minInclusive = getMinInclusive(); > if (minInclusive->isSet()) > { > if ( *value < minInclusive->getMinInclusiveAsDouble() ) > { > AxisString exceptionMessage = > "Value to be serialized is less than MinInclusive specified for this type. MinInclusive = "; > AxisChar* length = new AxisChar[25]; > sprintf(length, "%f", minInclusive->getMinInclusiveAsDouble()); > exceptionMessage += length; > exceptionMessage += ", Value = "; > sprintf(length, "%f", *value); > exceptionMessage += length; > exceptionMessage += "."; > delete [] length; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete minInclusive; > MinExclusive* minExclusive = getMinExclusive(); > if (minExclusive->isSet()) > { > if ( *value <= minExclusive->getMinExclusiveAsDouble() ) > { > AxisString exceptionMessage = > "Value to be serialized is less than or equal to MinExclusive specified for this type. MinExclusive = "; > AxisChar* length = new AxisChar[25]; > sprintf(length, "%f", minExclusive->getMinExclusiveAsDouble()); > exceptionMessage += length; > exceptionMessage += ", Value = "; > sprintf(length, "%f", *value); > exceptionMessage += length; > exceptionMessage += "."; > delete [] length; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete minExclusive; > > MaxInclusive* maxInclusive = getMaxInclusive(); > if (maxInclusive->isSet()) > { > if ( *value > maxInclusive->getMaxInclusiveAsDouble() ) > { > AxisString exceptionMessage = > "Value to be serialized is greater than MaxInclusive specified for this type. MaxInclusive = "; > AxisChar* length = new AxisChar[25]; > sprintf(length, "%f", maxInclusive->getMaxInclusiveAsDouble()); > exceptionMessage += length; > exceptionMessage += ", Value = "; > sprintf(length, "%f", *value); > exceptionMessage += length; > exceptionMessage += "."; > delete [] length; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete maxInclusive; > MaxExclusive* maxExclusive = getMaxExclusive(); > if (maxExclusive->isSet()) > { > if ( *value >= maxExclusive->getMaxExclusiveAsDouble() ) > { > AxisString exceptionMessage = > "Value to be serialized is greater than or equal to MaxExclusive specified for this type. MaxExclusive = "; > AxisChar* length = new AxisChar[25]; > sprintf(length, "%f", maxExclusive->getMaxExclusiveAsDouble()); > exceptionMessage += length; > exceptionMessage += ", Value = "; > sprintf(length, "%f", *value); > exceptionMessage += length; > exceptionMessage += "."; > delete [] length; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete maxExclusive; > > AxisChar* serializedValue = new char[80]; > AxisSprintf (serializedValue, 80, "%f", *value); > > IAnySimpleType::serialize(serializedValue); > delete [] serializedValue; > return m_Buf; > } > it seems that the memory used by minInclusive, minExclusive , etc will not be freed if an exception is thrown. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira