Skip to content

Commit d73cde7

Browse files
committed
Add explicit check for LoadFile success
1 parent 0c6b1a5 commit d73cde7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/analyzerinfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ bool AnalyzerInformation::analyzeFile(const std::string &buildDir, const std::st
153153
mAnalyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile(buildDir,sourcefile,cfg,fileIndex);
154154

155155
tinyxml2::XMLDocument analyzerInfoDoc;
156-
analyzerInfoDoc.LoadFile(mAnalyzerInfoFile.c_str());
157-
158-
if (skipAnalysis(analyzerInfoDoc, hash, errors))
156+
const tinyxml2::XMLError xmlError = analyzerInfoDoc.LoadFile(mAnalyzerInfoFile.c_str());
157+
if (xmlError == tinyxml2::XML_SUCCESS && skipAnalysis(analyzerInfoDoc, hash, errors))
159158
return false;
160159

161160
mOutputStream.open(mAnalyzerInfoFile);

0 commit comments

Comments
 (0)