[ 
http://issues.apache.org/jira/browse/XERCESC-1480?page=comments#action_12364696 
] 

David Bertoni commented on XERCESC-1480:
----------------------------------------

I would like to commit your recommended changes, but need you to answer these 5 
questions before I can do so:

a) Name and employer 

b) Are you the author of the code being contributed? 

c) Do you have the right to grant the copyright and patent licenses for the 
contribution that are set forth in the ASF v.2.0 license 
(http://www.apache.org/licenses/LICENSE-2.0)? 

d) Does your employer have any rights to code that you have written, for 
example, through your contract for employment? If so, has your employer given 
you permission to contribute the code on its behalf or waived its rights in the 
code? 

e) Are you aware of any third-party licenses or other restrictions (such as 
related patents or trademarks) that could apply to your contribution? If so, 
what are they? 

Thanks!

Dave

> Memory Leak when parsing input with an undefined encoding
> ---------------------------------------------------------
>
>          Key: XERCESC-1480
>          URL: http://issues.apache.org/jira/browse/XERCESC-1480
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.6.0
>  Environment: Reproduced on:
> Solaris 8: SunOS 5.8 Generic_117350-06 sun4u sparc SUNW,Sun-Fire-V240
> Suse Linux 9.2: Linux 2.6.8-24.14-default #1 Tue Mar 29 09:27:43 UTC 2005 
> i686 i686 i386 GNU/Linux
> Windows 2000/XP SP 2
>     Reporter: Tito Pena
>     Assignee: David Bertoni
>     Priority: Minor

>
> When creating an XMLReader object with an InputSource which has an unknown 
> encoding, a TranscodingException is thrown, leaking the fPublicId, fSystemId 
> and fEncodingStr members. This occurs on lines 261 and 357 in XMLReader.cpp.
> I am including a diff -C3 patch for the fille.
> *** ./xerces-c-src_2_6_0/src/xercesc/internal/XMLReader.cpp   Fri Aug 19 
> 13:19:46 2005
> --- ./xerces-c-src_2_6_0/src/xercesc/internal/XMLReader.cpp.pat       Fri Aug 
> 19 13:25:54 2005
> ***************
> *** 258,263 ****
> --- 258,267 ----
>   
>       if (!fTranscoder)
>       {
> +         fMemoryManager->deallocate(fPublicId);
> +         fMemoryManager->deallocate(fSystemId);
> +         ArrayJanitor<XMLCh> janValue(fEncodingStr, fMemoryManager);
> +             
>           ThrowXMLwithMemMgr1
>           (
>               TranscodingException
> ***************
> *** 354,359 ****
> --- 358,367 ----
>   
>       if (!fTranscoder)
>       {
> +         fMemoryManager->deallocate(fPublicId);
> +         fMemoryManager->deallocate(fSystemId);
> +         ArrayJanitor<XMLCh> janValue(fEncodingStr, fMemoryManager);
> + 
>           ThrowXMLwithMemMgr1
>           (
>               TranscodingException

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to