Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4746

ParentRecord *secondary_parents malloc,but no place free,which will cause memery leak

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0
    • Parent Proxy
    • None

    Description

      secondary_parents is malloc in
      ParentRecord::ProcessParents(char *val, bool isPrimary)
      this->secondary_parents = (pRecord *)ats_malloc(sizeof(pRecord) * numTok); //line:372

      but no place to free it,which will cause memery leak.

      fix in
      ParentRecord::~ParentRecord()
      {
      if(parents != NULL)

      { ats_free(parents); }

      if(primary_parents != NULL)

      { ats_free(primary_parents); }

      if(second_parents != NULL)

      { ats_free(second_parents); }

      ......

      Attachments

        Activity

          People

            jrushford John Rushford
            keith2008 xiangdong chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1.5h
                1.5h