Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-922

Resource leak in AttachmentHelper::extract_Attachment

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6 Final
    • current (nightly)
    • None
    • All platforms, this issue was found in nightly drop 24-Jan-2006 21:23

    Description

      File: server\apache2\AttachmentHelper.cpp
      Method: void AttachmentHelper::extract_Attachment(char *pBuffer)
      Line: 88 - 89

      This is a very easy bug to spot and fix:

      xsd_base64Binary* base64_attachment = new xsd_base64Binary();
      base64_attachment = AxisUtils::decodeFromBase64Binary(attach);

      In Java this code would be fine but in C++ is is a resource leak,
      the first new is not needed since decodeFromBase64Binary will allocate the xsd__base64Binary.
      I suggest replacing the two lines with this one:

      xsd__base64Binary* base64_attachment = AxisUtils::decodeFromBase64Binary(attach);

      /Emanuel

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            emanuel Emanuel Norrbin
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment