diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 1c7f3140a33e..6c9d52b955b9 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -314,13 +314,13 @@ namespace DOM } // extern "C" - void throwEx(xmlParserCtxtPtr ctxt) { - OUString msg = make_error_message(ctxt); - xmlFreeParserCtxt(ctxt); + void throwEx(xmlParserCtxtPtr ctxt) + { com::sun::star::xml::sax::SAXParseException saxex; - saxex.Message = msg; + saxex.Message = make_error_message(ctxt); saxex.LineNumber = static_cast(ctxt->lastError.line); saxex.ColumnNumber = static_cast(ctxt->lastError.int2); + xmlFreeParserCtxt(ctxt); throw saxex; }