summaryrefslogtreecommitdiff
path: root/libxerces-c/xercesc/internal/IGXMLScanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libxerces-c/xercesc/internal/IGXMLScanner.cpp')
-rw-r--r--libxerces-c/xercesc/internal/IGXMLScanner.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/libxerces-c/xercesc/internal/IGXMLScanner.cpp b/libxerces-c/xercesc/internal/IGXMLScanner.cpp
index aa344be..246a46a 100644
--- a/libxerces-c/xercesc/internal/IGXMLScanner.cpp
+++ b/libxerces-c/xercesc/internal/IGXMLScanner.cpp
@@ -1374,7 +1374,14 @@ void IGXMLScanner::scanDocTypeDecl()
// Get copies of the ids we got
pubId = XMLString::replicate(bbPubId.getRawBuffer(), fMemoryManager);
sysId = XMLString::replicate(bbSysId.getRawBuffer(), fMemoryManager);
+ }
+
+ // Insure that the ids get cleaned up, if they got allocated
+ ArrayJanitor<XMLCh> janSysId(sysId, fMemoryManager);
+ ArrayJanitor<XMLCh> janPubId(pubId, fMemoryManager);
+ if (hasExtSubset)
+ {
// Skip spaces and check again for the opening of an internal subset
fReaderMgr.skipPastSpaces();
@@ -1384,10 +1391,6 @@ void IGXMLScanner::scanDocTypeDecl()
}
}
- // Insure that the ids get cleaned up, if they got allocated
- ArrayJanitor<XMLCh> janSysId(sysId, fMemoryManager);
- ArrayJanitor<XMLCh> janPubId(pubId, fMemoryManager);
-
// If we have a doc type handler and advanced callbacks are enabled,
// call the doctype event.
if (fDocTypeHandler)