You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Mateusz Czapliński (JIRA)" <xe...@xml.apache.org> on 2007/12/14 13:57:43 UTC

[jira] Created: (XERCESC-1767) Output of XMLString::transcode not freed?

Output of XMLString::transcode not freed?
-----------------------------------------

                 Key: XERCESC-1767
                 URL: https://issues.apache.org/jira/browse/XERCESC-1767
             Project: Xerces-C++
          Issue Type: Bug
          Components: Documentation
         Environment: The Xerces-C++ webpage
            Reporter: Mateusz Czapliński
            Priority: Trivial


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."


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Resolved: (XERCESC-1767) Output of XMLString::transcode not freed?

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alberto Massari resolved XERCESC-1767.
--------------------------------------

    Resolution: Fixed
      Assignee: Alberto Massari

Fixed in SVN

> Output of XMLString::transcode not freed?
> -----------------------------------------
>
>                 Key: XERCESC-1767
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1767
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Documentation
>         Environment: The Xerces-C++ webpage
>            Reporter: Mateusz Czapliński
>            Assignee: Alberto Massari
>            Priority: Trivial
>
> 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."

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org