Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1767

Output of XMLString::transcode not freed?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • None
    • Documentation
    • None
    • The Xerces-C++ webpage

    Description

      In the example code snippet at
      http://xerces.apache.org/xerces-c/program-sax.html
      there's a fragment as follows:

      void MySAXHandler::fatalError(const SAXParseException& exception)
      {
      char* message = XMLString::transcode(exception.getMessage());
      cout << "Fatal Error: " << message
      << " at line: " << exception.getLineNumber()
      << endl;
      }

      This seems to contradict the claim in XMLString.hpp that the caller of XMLString::transcode() is responsible for freeing the memory.

      If there's some reason why this is OK there, it should be clearly stated. Especially as this is a basic hello-world-like example lots of people will presumably start with - and now it might be understood as "Oh, that's not really so important to free this memory, you know."

      Attachments

        Issue Links

          Activity

            People

              amassari Alberto Massari
              akavel Mateusz CzapliƄski
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: