Uploaded image for project: 'OpenDNSSEC'
  1. OpenDNSSEC
  2. OPENDNSSEC-810 Process coverity scan as reported on 2016-05-19
  3. OPENDNSSEC-815

resource leak in policy_export() (enforcer/src/policy/policy_export:404,257,252)

    XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      See parent issue for the coverty report on this issue:

      CID 112209: (RESOURCE_LEAK)
      /enforcer/src/policy/policy_export.c: 404 in __policy_export()
      398 policy_key_list_free(policy_key_list);
      399 return POLICY_EXPORT_ERR_DATABASE;
      400 }
      401 }
      402 policy_key_list_free(policy_key_list);
      403
      >>> CID 112209: (RESOURCE_LEAK)
      >>> Variable "duration" going out of scope leaks the storage it points to.
      404 return POLICY_EXPORT_OK;
      405 }
      406
      407 int policy_export_all(int sockfd, const db_connection_t* connection, const char* filename)

      Unknown macro: { 408 policy_list_t* policy_list; 409 const policy_t* policy; /enforcer/src/policy/policy_export.c}

      401 }
      402 policy_key_list_free(policy_key_list);
      403
      >>> CID 112209: (RESOURCE_LEAK)
      >>> Variable "duration" going out of scope leaks the storage it points to.
      404 return POLICY_EXPORT_OK;
      405 }
      406
      407 int policy_export_all(int sockfd, const db_connection_t* connection, const char* filename)

      Unknown macro: { 408 policy_list_t* policy_list; 409 const policy_t* policy; /enforcer/src/policy/policy_export.c}

      254 __free(&duration_text);
      255
      256 if (!(policy_key_list = policy_get_policy_keys(policy)))

      Unknown macro: { >>> CID 112209}

      259
      260 for (policy_key = policy_key_list_next(policy_key_list); policy_key; policy_key = policy_key_list_next(policy_key_list)) {
      261 switch (policy_key_role(policy_key)) {
      262 case POLICY_KEY_ROLE_ZSK:
      /enforcer/src/policy/policy_export.c: 252 in __policy_export()
      246 || !(node4 = xmlNewChild(node3, NULL, (xmlChar*)"Minimum", (xmlChar*)duration_text))
      247 || __free(&duration_text)
      248 )
      249

      Unknown macro: { 250 client_printf_err(sockfd, "Unable to create XML elements, error code %d!n", error); 251 __free(&duration_text); >>> CID 112209}

      254 __free(&duration_text);
      255
      256 if (!(policy_key_list = policy_get_policy_keys(policy))) {
      257 return POLICY_EXPORT_ERR_DATABASE;

        Attachments

          Activity

            People

            Assignee:
            hodar Hoda Rohani
            Reporter:
            berry Berry van Halderen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 6 hours
                6h
                Remaining:
                Remaining Estimate - 6 hours
                6h
                Logged:
                Time Spent - Not Specified
                Not Specified