This is an automated email from the ASF dual-hosted git repository.

scantor pushed a commit to branch xerces-3.2
in repository https://gitbox.apache.org/repos/asf/xerces-c.git

commit 05dbb6a5fd5a8992ae249b0d2fa13729e6b8122f
Author: Scott Cantor <canto...@osu.edu>
AuthorDate: Wed Oct 5 13:58:28 2022 -0400

    Revert "Merge pull request #31 from rouault/fix_ossfuzz_37529_backport_3_2"
    
    This reverts commit a3be9dc2060a1921157dca652524f1841d948616, reversing
    changes made to 9ac2a9cb749e307b67e4622f77ff66cb9f05f584.
---
 src/xercesc/internal/ReaderMgr.cpp |  6 -----
 src/xercesc/internal/XMLReader.cpp | 47 +++++---------------------------------
 src/xercesc/internal/XMLReader.hpp |  2 --
 3 files changed, 6 insertions(+), 49 deletions(-)

diff --git a/src/xercesc/internal/ReaderMgr.cpp 
b/src/xercesc/internal/ReaderMgr.cpp
index 18d859602..d14483e3c 100644
--- a/src/xercesc/internal/ReaderMgr.cpp
+++ b/src/xercesc/internal/ReaderMgr.cpp
@@ -436,12 +436,6 @@ XMLReader* ReaderMgr::createReader( const   InputSource&   
     src
                 );
         }
     }
-    catch(const XMLPlatformUtilsException&)
-    {
-        streamJanitor.release();
-
-        throw;
-    }
     catch(const OutOfMemoryException&)
     {
         streamJanitor.release();
diff --git a/src/xercesc/internal/XMLReader.cpp 
b/src/xercesc/internal/XMLReader.cpp
index 9acfad8c0..405474a02 100644
--- a/src/xercesc/internal/XMLReader.cpp
+++ b/src/xercesc/internal/XMLReader.cpp
@@ -124,16 +124,8 @@ XMLReader::XMLReader(const  XMLCh* const          pubId
 {
     setXMLVersion(version);
 
-    try
-    {
-        // Do an initial load of raw bytes
-        refreshRawBuffer();
-    }
-    catch (const XMLPlatformUtilsException&)
-    {
-        cleanup();
-        throw;
-    }
+    // Do an initial load of raw bytes
+    refreshRawBuffer();
 
     // Ask the transcoding service if it supports src offset info
     fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs();
@@ -215,16 +207,8 @@ XMLReader::XMLReader(const  XMLCh* const          pubId
 {
     setXMLVersion(version);
 
-    try
-    {
-        // Do an initial load of raw bytes
-        refreshRawBuffer();
-    }
-    catch (const XMLPlatformUtilsException&)
-    {
-        cleanup();
-        throw;
-    }
+    // Do an initial load of raw bytes
+    refreshRawBuffer();
 
     // Copy the encoding string to our member
     fEncodingStr = XMLString::replicate(encodingStr, fMemoryManager);
@@ -406,16 +390,8 @@ XMLReader::XMLReader(const  XMLCh* const          pubId
 {
     setXMLVersion(version);
 
-    try
-    {
-        // Do an initial load of raw bytes
-        refreshRawBuffer();
-    }
-    catch (const XMLPlatformUtilsException&)
-    {
-        cleanup();
-        throw;
-    }
+    // Do an initial load of raw bytes
+    refreshRawBuffer();
 
     // Ask the transcoding service if it supports src offset info
     fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs();
@@ -479,23 +455,12 @@ XMLReader::XMLReader(const  XMLCh* const          pubId
 
 
 XMLReader::~XMLReader()
-{
-    cleanup();
-}
-
-
-void XMLReader::cleanup()
 {
     fMemoryManager->deallocate(fEncodingStr);
-    fEncodingStr = NULL;
     fMemoryManager->deallocate(fPublicId);
-    fPublicId = NULL;
     fMemoryManager->deallocate(fSystemId);
-    fSystemId = NULL;
     delete fStream;
-    fStream = NULL;
     delete fTranscoder;
-    fTranscoder = NULL;
 }
 
 
diff --git a/src/xercesc/internal/XMLReader.hpp 
b/src/xercesc/internal/XMLReader.hpp
index fbacb2685..966ca224d 100644
--- a/src/xercesc/internal/XMLReader.hpp
+++ b/src/xercesc/internal/XMLReader.hpp
@@ -253,8 +253,6 @@ private:
     // -----------------------------------------------------------------------
     //  Private helper methods
     // -----------------------------------------------------------------------
-    void cleanup();
-
     void checkForSwapped();
 
     void doInitCharSizeChecks();


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

Reply via email to