diff --git a/src/libxml2_loader.cpp b/src/libxml2_loader.cpp index 278d46706..85ca05e0b 100644 --- a/src/libxml2_loader.cpp +++ b/src/libxml2_loader.cpp @@ -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_);