You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Tito Pena (JIRA)" <xe...@xml.apache.org> on 2005/08/22 08:00:08 UTC

[jira] Created: (XERCESC-1480) Memory Leak when parsing input with an undefined encoding

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
    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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Assigned: (XERCESC-1480) Memory Leak when parsing input with an undefined encoding

Posted by "David Bertoni (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1480?page=all ]

David Bertoni reassigned XERCESC-1480:
--------------------------------------

    Assign To: David Bertoni

> 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1480) Memory Leak when parsing input with an undefined encoding

Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov updated XERCESC-1480:
-------------------------------------

      Component/s: Utilities
         Priority: Major  (was: Minor)
    Fix Version/s: 3.1.0

Should probably try to fix this for 3.1.0 if it is still there.

> Memory Leak when parsing input with an undefined encoding
> ---------------------------------------------------------
>
>                 Key: XERCESC-1480
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1480
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Utilities
>    Affects 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
>             Fix For: 3.1.0
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Closed: (XERCESC-1480) Memory Leak when parsing input with an undefined encoding

Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov closed XERCESC-1480.
------------------------------------

    Resolution: Fixed

Fix is in SVN.

> Memory Leak when parsing input with an undefined encoding
> ---------------------------------------------------------
>
>                 Key: XERCESC-1480
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1480
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Utilities
>    Affects 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
>             Fix For: 3.1.0
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1480) Memory Leak when parsing input with an undefined encoding

Posted by "David Bertoni (JIRA)" <xe...@xml.apache.org>.
    [ 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org