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

CID 1343608, 1343607: Parent selection Coverity issues

    XMLWordPrintableJSON

Details

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

    Description

      This is from the refactoring I'm pretty sure.

      ** CID 1343608:  Resource leaks  (CTOR_DTOR_LEAK)
      /proxy/ParentSelection.cc: 95 in ParentConfigParams::ParentConfigParams(ControlMatcher<ParentRecord, ParentResult> *)()
      
      
      ________________________________________________________________________________________________________
      *** CID 1343608:  Resource leaks  (CTOR_DTOR_LEAK)
      /proxy/ParentSelection.cc: 95 in ParentConfigParams::ParentConfigParams(ControlMatcher<ParentRecord, ParentResult> *)()
      89     
      90     ParentConfigParams::ParentConfigParams(P_table *_parent_table)
      91     {
      92       char *default_val = NULL;
      93       parent_table = _parent_table;
      94     
         CID 1343608:  Resource leaks  (CTOR_DTOR_LEAK)
         The constructor allocates field "policy" of "ParentConfigParams" but the destructor and whatever functions it calls do not free it.
      95       policy = new ParentSelectionPolicy();
      96     
      97       // Handle default parent
      98       PARENT_ReadConfigStringAlloc(default_val, default_var);
      99       DefaultParent = createDefaultParent(default_val);
      100       ats_free(default_val);
      
      ** CID 1343607:  Null pointer dereferences  (FORWARD_NULL)
      /proxy/ParentConsistentHash.cc: 158 in ParentConsistentHash::selectParent(const ParentSelectionPolicy *, bool, ParentResult *, RequestData *)()
      
      
      ________________________________________________________________________________________________________
      *** CID 1343607:  Null pointer dereferences  (FORWARD_NULL)
      /proxy/ParentConsistentHash.cc: 158 in ParentConsistentHash::selectParent(const ParentSelectionPolicy *, bool, ParentResult *, RequestData *)()
      152             Debug("parent_select", "Parent.failedAt = %u, retry = %u, xact_start = %u", (unsigned int)pRec->failedAt,
      153                   (unsigned int)policy->ParentRetryTime, (unsigned int)request_info->xact_start);
      154             if ((pRec->failedAt + policy->ParentRetryTime) < request_info->xact_start) {
      155               parentRetry = true;
      156               // make sure that the proper state is recorded in the result structure
      157               // so that markParentUp() finds the proper record.
         CID 1343607:  Null pointer dereferences  (FORWARD_NULL)
         Dereferencing null pointer "prtmp".
      158               result->last_parent = prtmp->idx;
      159               result->last_lookup = last_lookup;
      160               result->retry = parentRetry;
      161               result->r = PARENT_SPECIFIED;
      162               markParentUp(result);
      163               Debug("parent_select", "Down parent %s is now retryable, marked it available.", pRec->hostname);
      

      Attachments

        Activity

          People

            jrushford John Rushford
            zwoop Leif Hedstrom
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: