Merge pull request #1190 from ssinger/fix_segfault
Avoid dereferencing a null error structure
This commit is contained in:
commit
2f8d08c366
1 changed files with 5 additions and 1 deletions
|
@ -135,11 +135,15 @@ public:
|
|||
xmlError * error = xmlCtxtGetLastError( ctx_ );
|
||||
std::ostringstream os;
|
||||
os << "XML document not well formed";
|
||||
int line=0;
|
||||
std::string file;
|
||||
if (error)
|
||||
{
|
||||
os << ": " << std::endl << error->message;
|
||||
line = error->line;
|
||||
file = error->file;
|
||||
}
|
||||
throw config_error(os.str(), error->line, error->file);
|
||||
throw config_error(os.str(), line, file);
|
||||
}
|
||||
|
||||
int iXIncludeReturn = xmlXIncludeProcessFlags(doc, options_);
|
||||
|
|
Loading…
Reference in a new issue