Traffic Server
  1. Traffic Server
  2. TS-826

TSHttpTxnErrorBodySet() can leak memory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.9, 2.1.8, 2.1.7, 2.1.6, 2.1.5, 2.1.4
    • Fix Version/s: 3.1.0, 3.0.1
    • Component/s: TS API
    • Labels:
      None

      Description

      TSHttpTxnErrorBodySet() sets HttpSM::t_state.internal_msg_buffer without freeing any old contents in there.
      There can be an error message in that if you have a request with a bad hostname and you let the transaction get past DNS
      lookup. Instead it should free the contents, or there should be another field that it sets and nothing else does.

      1. ebs.diff
        0.8 kB
        William Bardwell

        Activity

        Hide
        Brian Geffon added a comment -
        Show
        Brian Geffon added a comment - Opened bug https://issues.apache.org/jira/browse/TS-1038
        Hide
        Brian Geffon added a comment - - edited

        Correct me if I'm wrong but with this patch it's still leaking mimetype. See HttpSM::setup_internal_transfer line 5416 which frees internal_msg_buffer_type...it's expected that mimetype was malloced since clearly it's being freed. So that means there is still a memory leak in TSHttpTxnErrorBodySet().

        Show
        Brian Geffon added a comment - - edited Correct me if I'm wrong but with this patch it's still leaking mimetype. See HttpSM::setup_internal_transfer line 5416 which frees internal_msg_buffer_type...it's expected that mimetype was malloced since clearly it's being freed. So that means there is still a memory leak in TSHttpTxnErrorBodySet().
        Hide
        Leif Hedstrom added a comment -

        Resolved on both 3.0.x and trunk.

        Show
        Leif Hedstrom added a comment - Resolved on both 3.0.x and trunk.
        Hide
        William Bardwell added a comment -

        Patch based on what TSHttpTxnServerRequestBodySet does.

        Show
        William Bardwell added a comment - Patch based on what TSHttpTxnServerRequestBodySet does.

          People

          • Assignee:
            Leif Hedstrom
            Reporter:
            William Bardwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development