--- parser3/src/main/pa_xml_exception.C 2023/09/26 20:49:10 1.13 +++ parser3/src/main/pa_xml_exception.C 2026/10/18 22:42:43 1.17 @@ -1,7 +1,7 @@ /** @file Parser: exception class. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ @@ -14,29 +14,29 @@ #include "pa_common.h" #include "pa_charset.h" -volatile const char * IDENT_PA_XML_EXCEPTION_C="$Id: pa_xml_exception.C,v 1.13 2023/09/26 20:49:10 moko Exp $" IDENT_PA_XML_EXCEPTION_H; +volatile const char * IDENT_PA_XML_EXCEPTION_C="$Id: pa_xml_exception.C,v 1.17 2026/10/18 22:42:43 moko Exp $" IDENT_PA_XML_EXCEPTION_H; // methods XmlException::XmlException(const String* aproblem_source, const char* aproblem_comment, ...) { ftype="xml"; - fproblem_source=aproblem_source; + fproblem_source=pa_gc_reference(aproblem_source); - fcomment=new(PointerFreeGC) char[MAX_STRING]; + fcomment=pa_gc_reference(new(PointerFreeGC) char[MAX_STRING]); va_list args; va_start(args, aproblem_comment); - vsnprintf((char *)fcomment, MAX_STRING, aproblem_comment, args); + pa_vsnprintf((char *)fcomment, MAX_STRING, aproblem_comment, args); va_end(args); } XmlException::XmlException(const String* aproblem_source, Request& r){ ftype="xml"; - fproblem_source=aproblem_source; + fproblem_source=pa_gc_reference(aproblem_source); if(const char* xml_generic_errors=xmlGenericErrors()){ - fcomment=pa_strdup(xml_generic_errors); + fcomment=pa_gc_reference(pa_strdup(xml_generic_errors)); if(r.charsets.source().isUTF8()) - fcomment=fixUTF8(fcomment); + fcomment=pa_gc_reference(fixUTF8(fcomment)); } else fcomment="-UNKNOWN ERROR-"; } @@ -46,7 +46,7 @@ XmlException::XmlException(){ fproblem_source=0; if(const char* xml_generic_errors=xmlGenericErrors()) - fcomment=pa_strdup(xml_generic_errors); + fcomment=pa_gc_reference(pa_strdup(xml_generic_errors)); else fcomment="-UNKNOWN ERROR-"; }