Uploaded image for project: 'OpenDNSSEC'
  1. OpenDNSSEC
  2. OPENDNSSEC-810

Process coverity scan as reported on 2016-05-19

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      Please find the latest report on new defect(s) introduced to opendnssec/opendnssec found with Coverity Scan.

      32 new defect(s) introduced to opendnssec/opendnssec found with Coverity Scan.
      12 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

      New defect(s) Reported-by: Coverity Scanm
      Showing 20 of 32 defect(s)

        • CID 112218: Memory - illegal accesses (USE_AFTER_FREE)
          /libhsm/src/lib/libhsm.c: 695 in hsm_ctx_free()

      ________________________________________________________________________________________________________

          • CID 112218: Memory - illegal accesses (USE_AFTER_FREE)
            /libhsm/src/lib/libhsm.c: 695 in hsm_ctx_free()
            689 {
            690 unsigned int i;
            691 if (ctx)
            Unknown macro: {692 for (i = 0; i < ctx->session_count; i++) { 693 hsm_session_free(ctx->session[i]); 694 }>>> CID 112218}

            697
            698 keycache_destroy(ctx);
            699 }
            700

        • CID 112217: Memory - illegal accesses (USE_AFTER_FREE)
          /signer/src/wire/tsig.c: 194 in tsig_key_create()

      ________________________________________________________________________________________________________

          • CID 112217: Memory - illegal accesses (USE_AFTER_FREE)
            /signer/src/wire/tsig.c: 194 in tsig_key_create()
            188 "secret", tsig_str, tsig->name);
            189 ldns_rdf_deep_free(dname);
            190 free(data);
            191 }
            192 key->dname = dname;
            193 key->size = size;
            >>> CID 112217: Memory - illegal accesses (USE_AFTER_FREE)
            >>> Using freed pointer "data".
            194 key->data = data;
            195 tsig_handler_add_key(key);
            196 return key;
            197 }
            198
            199
        • CID 112216: Memory - illegal accesses (UNINIT)
          /signer/src/daemon/engine.c: 73 in engine_create()

      ________________________________________________________________________________________________________

          • CID 112216: Memory - illegal accesses (UNINIT)
            /signer/src/daemon/engine.c: 73 in engine_create()
            67 *
            68 */
            69 static engine_type*
            70 engine_create(void)
            71 {
            72 engine_type* engine;
            >>> CID 112216: Memory - illegal accesses (UNINIT)
            >>> Assigning: "engine" = "(engine_type *)malloc(216UL)", which is allocated but not initialized.
            73 CHECKALLOC(engine = (engine_type*) malloc(sizeof(engine_type)));
            74 engine->config = NULL;
            75 engine->workers = NULL;
            76 engine->drudgers = NULL;
            77 engine->cmdhandler = NULL;
            78 engine->cmdhandler_done = 0;
        • CID 112215: Memory - illegal accesses (UNINIT)
          /signer/src/signer/zone.c: 61 in zone_create()

      ________________________________________________________________________________________________________

          • CID 112215: Memory - illegal accesses (UNINIT)
            /signer/src/signer/zone.c: 61 in zone_create()
            55 {
            56 zone_type* zone = NULL;
            57
            58 if (!name || !klass) { 59 return NULL; 60 }

            >>> CID 112215: Memory - illegal accesses (UNINIT)
            >>> Assigning: "zone" = "(zone_type *)malloc(232UL)", which is allocated but not initialized.
            61 CHECKALLOC(zone = (zone_type*) malloc(sizeof(zone_type)));
            62 /* [start] PS 9218653: Drop trailing dot in domain name */
            63 if (strlen(name) > 1 && name[strlen(name)-1] == '.')

            { 64 name[strlen(name)-1] = '\0'; 65 }

            66 /* [end] PS 9218653 */

        • CID 112214: Null pointer dereferences (REVERSE_INULL)
          /libhsm/checks/hsmcheck.c: 243 in main()

      ________________________________________________________________________________________________________

          • CID 112214: Null pointer dereferences (REVERSE_INULL)
            /libhsm/checks/hsmcheck.c: 243 in main()
            237 printf("random 64: %llu\n", (long long unsigned int)r64);
            238 }
            239
            240 /*
            241 * Destroy HSM context
            242 */
            >>> CID 112214: Null pointer dereferences (REVERSE_INULL)
            >>> Null-checking "ctx" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
            243 if (ctx) { 244 hsm_destroy_context(ctx); 245 }

            246
            247 /*
            248 * Close HSM library

        • CID 112213: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()

      ________________________________________________________________________________________________________

          • CID 112213: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()
            159 /* key is purgable */
            160 ods_log_info("[%s] deleting key: %s", scmd,
            161 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            162 client_printf (sockfd, "deleting key: %s\n",
            163 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            164
            >>> CID 112213: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "key_data_get_cached_rrsig(keylist[i])" leaks it.
            165 if (key_state_delete(key_data_get_cached_ds(keylist[i]))
            166 || key_state_delete(key_data_get_cached_dnskey(keylist[i]))
            167 || key_state_delete(key_data_get_cached_rrsigdnskey(keylist[i]))
            168 || key_state_delete(key_data_get_cached_rrsig(keylist[i]))
            169 || key_data_delete(keylist[i])
            170 || hsm_key_factory_release_key_id(hsm_key_id(key_data_cached_hsm_key(keylist[i])), dbconn))
        • CID 112212: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()

      ________________________________________________________________________________________________________

          • CID 112212: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()
            159 /* key is purgable */
            160 ods_log_info("[%s] deleting key: %s", scmd,
            161 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            162 client_printf (sockfd, "deleting key: %s\n",
            163 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            164
            >>> CID 112212: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "key_data_get_cached_rrsigdnskey(keylist[i])" leaks it.
            165 if (key_state_delete(key_data_get_cached_ds(keylist[i]))
            166 || key_state_delete(key_data_get_cached_dnskey(keylist[i]))
            167 || key_state_delete(key_data_get_cached_rrsigdnskey(keylist[i]))
            168 || key_state_delete(key_data_get_cached_rrsig(keylist[i]))
            169 || key_data_delete(keylist[i])
            170 || hsm_key_factory_release_key_id(hsm_key_id(key_data_cached_hsm_key(keylist[i])), dbconn))
        • CID 112211: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()

      ________________________________________________________________________________________________________

          • CID 112211: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()
            159 /* key is purgable */
            160 ods_log_info("[%s] deleting key: %s", scmd,
            161 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            162 client_printf (sockfd, "deleting key: %s\n",
            163 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            164
            >>> CID 112211: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "key_data_get_cached_ds(keylist[i])" leaks it.
            165 if (key_state_delete(key_data_get_cached_ds(keylist[i]))
            166 || key_state_delete(key_data_get_cached_dnskey(keylist[i]))
            167 || key_state_delete(key_data_get_cached_rrsigdnskey(keylist[i]))
            168 || key_state_delete(key_data_get_cached_rrsig(keylist[i]))
            169 || key_data_delete(keylist[i])
            170 || hsm_key_factory_release_key_id(hsm_key_id(key_data_cached_hsm_key(keylist[i])), dbconn))
        • CID 112210: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()

      ________________________________________________________________________________________________________

          • CID 112210: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/key_purge.c: 165 in removeDeadKeysNow()
            159 /* key is purgable */
            160 ods_log_info("[%s] deleting key: %s", scmd,
            161 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            162 client_printf (sockfd, "deleting key: %s\n",
            163 hsm_key_locator(key_data_cached_hsm_key(keylist[i])));
            164
            >>> CID 112210: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "key_data_get_cached_dnskey(keylist[i])" leaks it.
            165 if (key_state_delete(key_data_get_cached_ds(keylist[i]))
            166 || key_state_delete(key_data_get_cached_dnskey(keylist[i]))
            167 || key_state_delete(key_data_get_cached_rrsigdnskey(keylist[i]))
            168 || key_state_delete(key_data_get_cached_rrsig(keylist[i]))
            169 || key_data_delete(keylist[i])
            170 || hsm_key_factory_release_key_id(hsm_key_id(key_data_cached_hsm_key(keylist[i])), dbconn))
        • CID 112209: (RESOURCE_LEAK)
          /enforcer/src/policy/policy_export.c: 404 in __policy_export()
          /enforcer/src/policy/policy_export.c: 404 in __policy_export()
          /enforcer/src/policy/policy_export.c: 257 in __policy_export()
          /enforcer/src/policy/policy_export.c: 252 in __policy_export()

      ________________________________________________________________________________________________________

          • 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) { 408 policy_list_t* policy_list; 409 const policy_t* policy; /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)

            { 408 policy_list_t* policy_list; 409 const policy_t* policy; /enforcer/src/policy/policy_export.c: 257 in __policy_export() 251 __free(&duration_text); 252 return POLICY_EXPORT_ERR_XML; 253 }

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

            { >>> CID 112209: (RESOURCE_LEAK) >>> Variable "duration" going out of scope leaks the storage it points to. 257 return POLICY_EXPORT_ERR_DATABASE; 258 }

            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

            { 250 client_printf_err(sockfd, "Unable to create XML elements, error code %d!\n", error); 251 __free(&duration_text); >>> CID 112209: (RESOURCE_LEAK) >>> Variable "duration" going out of scope leaks the storage it points to. 252 return POLICY_EXPORT_ERR_XML; 253 }

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

        • CID 112208: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/keystate_import_cmd.c: 485 in run()

      ________________________________________________________________________________________________________

          • CID 112208: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/keystate_import_cmd.c: 485 in run()
            479 else if (!strcasecmp(keytype, "ZSK"))
            480 type = 2;
            481 else if (!strcasecmp(keytype, "CSK"))
            482 type = 3;
            483
            484 hsmkey_id = db_value_new();
            >>> CID 112208: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "zone_policy_id(zone_new_get_by_name(dbconn, zonename))" leaks it.
            485 policy_key = policy_key_new_get_by_policyid_and_role(dbconn, zone_policy_id(zone_new_get_by_name(dbconn, zonename)), type);
            486 if (!policy_key) { 487 ods_log_error("Unable to get policyKey, database error!"); 488 client_printf_err(sockfd, "Unable to get policyKey, database error!\n"); 489 db_value_free((void*)hsmkey_id); 490 return -1; ** CID 112207: Resource leaks (RESOURCE_LEAK) /enforcer/src/keystate/keystate_import_cmd.c: 244 in perform_keystate_import() ________________________________________________________________________________________________________ *** CID 112207: Resource leaks (RESOURCE_LEAK) /enforcer/src/keystate/keystate_import_cmd.c: 244 in perform_keystate_import() 238 }

            239 free(libhsmkey);
            240 key = key_data_new_get_by_hsm_key_id(dbconn, hsmkeyid);
            241 keydataid = key_data_id(key);
            242
            243 policy = policy_new(dbconn);
            >>> CID 112207: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "zone_policy_id(zone_new_get_by_name(dbconn, zonename))" leaks it.
            244 policy_get_by_id(policy, zone_policy_id(zone_new_get_by_name(dbconn, zonename)));
            245
            246 if (!(key_state = key_state_new(dbconn))
            247 || key_state_set_key_data_id(key_state, keydataid)
            248 || key_state_set_type(key_state, KEY_STATE_TYPE_DS)
            249 || key_state_set_last_change (key_state, time)

        • CID 112206: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/keystate_import_cmd.c: 172 in perform_keydata_import()

      ________________________________________________________________________________________________________

          • CID 112206: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/keystate_import_cmd.c: 172 in perform_keydata_import()
            166 return -1;
            167 }
            168 if (hsm_keytag(ckaid, alg, keytype == 1 ? 1 : 0, &tag)) { 169 ods_log_error("[%s] Error: Keytag for this key %s is not correct", module_str, ckaid); 170 }

            171
            >>> CID 112206: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "zone_id(zone_new_get_by_name(dbconn, zonename))" leaks it.
            172 if (!(key_data = key_data_new(dbconn))
            173 || key_data_set_zone_id(key_data, zone_id(zone_new_get_by_name(dbconn, zonename)))
            174 || key_data_set_hsm_key_id(key_data, hsm_key_id(hsmkey))
            175 || key_data_set_algorithm (key_data, alg)
            176 || key_data_set_inception(key_data, time)
            177 || key_data_set_introducing (key_data, keystate < 4 ? 1 : 0)

        • CID 112205: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/keystate/keystate_import_cmd.c: 103 in perform_hsmkey_import()

      ________________________________________________________________________________________________________

          • CID 112205: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/keystate/keystate_import_cmd.c: 103 in perform_hsmkey_import()
            97 client_printf_err(sockfd, "Already used this key with this locator: %s\n", ckaid);
            98 hsm_key_free(hsm_key);
            99 hsm_destroy_context(hsm_ctx);
            100 return -1;
            101 }
            102
            >>> CID 112205: Resource leaks (RESOURCE_LEAK)
            >>> Failing to save or free storage allocated by "zone_policy_id(zone_new_get_by_name(dbconn, zonename))" leaks it.
            103 if (!(hsm_key = hsm_key_new(dbconn))
            104 || hsm_key_set_algorithm(hsm_key, alg)
            105 || hsm_key_set_bits(hsm_key, bits)
            106 || hsm_key_set_inception(hsm_key, time)
            107 || hsm_key_set_key_type(hsm_key, HSM_KEY_KEY_TYPE_RSA)
            108 || hsm_key_set_locator(hsm_key, ckaid)
        • CID 112204: (RESOURCE_LEAK)
          /signer/src/parser/zonelistparser.c: 129 in parse_zonelist_adapter()
          /signer/src/parser/zonelistparser.c: 122 in parse_zonelist_adapter()
          /signer/src/parser/zonelistparser.c: 127 in parse_zonelist_adapter()
          /signer/src/parser/zonelistparser.c: 129 in parse_zonelist_adapter()
          /signer/src/parser/zonelistparser.c: 122 in parse_zonelist_adapter()
          /signer/src/parser/zonelistparser.c: 127 in parse_zonelist_adapter()

      ________________________________________________________________________________________________________

          • CID 112204: (RESOURCE_LEAK)
            /signer/src/parser/zonelistparser.c: 129 in parse_zonelist_adapter()
            123 } else if (xmlStrEqual(curNode->name,
            124 (const xmlChar*)"Adapter"))
            Unknown macro: {125 type = xmlGetProp(curNode, (const xmlChar*)"type");126 if (xmlStrEqual(type, (const xmlChar*)"File")) { 127 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 128 } else if (xmlStrEqual(type, (const xmlChar*)"DNS")) { >>> CID 112204: (RESOURCE_LEAK) >>> Overwriting "adapter" in "adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound)" leaks the storage that "adapter" points to. 129 adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound); 130 } else { 131 ods_log_error("[%s] unable to parse %s adapter: " 132 "unknown type", parser_str, (const char*) type); 133 }
            134 free((void*)type);
            /signer/src/parser/zonelistparser.c: 122 in parse_zonelist_adapter()
            116 }
            117 if (xpathObj->nodesetval) {
            118 for (i=0; i < xpathObj->nodesetval->nodeNr; i++) {
            119 curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
            120 while (curNode) {
            121 if (xmlStrEqual(curNode->name, (const xmlChar*)"File")) { >>> CID 112204: (RESOURCE_LEAK) >>> Overwriting "adapter" in "adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound)" leaks the storage that "adapter" points to. 122 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 123 } else if (xmlStrEqual(curNode->name,
            124 (const xmlChar*)"Adapter")) {
            125 type = xmlGetProp(curNode, (const xmlChar*)"type");
            126 if (xmlStrEqual(type, (const xmlChar*)"File")) {
            127 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound);
            /signer/src/parser/zonelistparser.c: 127 in parse_zonelist_adapter()
            121 if (xmlStrEqual(curNode->name, (const xmlChar*)"File")) { 122 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 123 } else if (xmlStrEqual(curNode->name,
            124 (const xmlChar*)"Adapter")) {
            125 type = xmlGetProp(curNode, (const xmlChar*)"type");
            126 if (xmlStrEqual(type, (const xmlChar*)"File")) { >>> CID 112204: (RESOURCE_LEAK) >>> Overwriting "adapter" in "adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound)" leaks the storage that "adapter" points to. 127 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 128 } else if (xmlStrEqual(type, (const xmlChar*)"DNS")) { 129 adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound); 130 } else { 131 ods_log_error("[%s] unable to parse %s adapter: " 132 "unknown type", parser_str, (const char*) type); /signer/src/parser/zonelistparser.c: 129 in parse_zonelist_adapter() 123 } else if (xmlStrEqual(curNode->name,
            124 (const xmlChar*)"Adapter")) {
            125 type = xmlGetProp(curNode, (const xmlChar*)"type");
            126 if (xmlStrEqual(type, (const xmlChar*)"File")) { 127 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 128 } else if (xmlStrEqual(type, (const xmlChar*)"DNS")) { >>> CID 112204: (RESOURCE_LEAK) >>> Overwriting "adapter" in "adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound)" leaks the storage that "adapter" points to. 129 adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound); 130 } else { 131 ods_log_error("[%s] unable to parse %s adapter: " 132 "unknown type", parser_str, (const char*) type); 133 }134 free((void*)type);/signer/src/parser/zonelistparser.c}

            117 if (xpathObj->nodesetval) {
            118 for (i=0; i < xpathObj->nodesetval->nodeNr; i++) {
            119 curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
            120 while (curNode) {
            121 if (xmlStrEqual(curNode->name, (const xmlChar*)"File"))

            { >>> CID 112204: (RESOURCE_LEAK) >>> Overwriting "adapter" in "adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound)" leaks the storage that "adapter" points to. 122 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 123 }

            else if (xmlStrEqual(curNode->name,
            124 (const xmlChar*)"Adapter")) {
            125 type = xmlGetProp(curNode, (const xmlChar*)"type");
            126 if (xmlStrEqual(type, (const xmlChar*)"File")) {
            127 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound);
            /signer/src/parser/zonelistparser.c: 127 in parse_zonelist_adapter()
            121 if (xmlStrEqual(curNode->name, (const xmlChar*)"File"))

            { 122 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 123 }

            else if (xmlStrEqual(curNode->name,
            124 (const xmlChar*)"Adapter")) {
            125 type = xmlGetProp(curNode, (const xmlChar*)"type");
            126 if (xmlStrEqual(type, (const xmlChar*)"File"))

            { >>> CID 112204: (RESOURCE_LEAK) >>> Overwriting "adapter" in "adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound)" leaks the storage that "adapter" points to. 127 adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); 128 }

            else if (xmlStrEqual(type, (const xmlChar*)"DNS"))

            { 129 adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound); 130 }

            else {
            131 ods_log_error("[%s] unable to parse %s adapter: "
            132 "unknown type", parser_str, (const char*) type);

        • CID 112203: Resource leaks (RESOURCE_LEAK)
          /enforcer/src/enforcer/repositorylist_cmd.c: 91 in perform_repositorylist()

      ________________________________________________________________________________________________________

          • CID 112203: Resource leaks (RESOURCE_LEAK)
            /enforcer/src/enforcer/repositorylist_cmd.c: 91 in perform_repositorylist()
            85 repository = (char*)xmlGetProp(xpathObj->nodesetval->nodeTab[i], (const xmlChar *)"name");
            86
            87 while (curNode)
            Unknown macro: {88 if (xmlStrEqual(curNode->name, (const xmlChar *)"Capacity"))89 capacity = (char*) xmlNodeGetContent(curNode);90 if (xmlStrEqual(curNode->name, (const xmlChar *)"RequireBackup")){ >>> CID 112203: Resource leaks (RESOURCE_LEAK) >>> Overwriting "backup" in "backup = strdup("Yes")" leaks the storage that "backup" points to. 91 backup = strdup("Yes"); 92 }93 curNode = curNode->next;94 }

            95 client_printf(sockfd, fmt, repository, capacity?capacity:"-", backup?backup:"No");
            96 free(repository);

        • CID 112202: Resource leaks (RESOURCE_LEAK)
          /signer/src/daemon/dnshandler.c: 218 in dnshandler_start()

      ________________________________________________________________________________________________________

          • CID 112202: Resource leaks (RESOURCE_LEAK)
            /signer/src/daemon/dnshandler.c: 218 in dnshandler_start()
            212 }
            213 if (dnshandler->socklist->tcp[i].s != -1) { 214 close(dnshandler->socklist->tcp[i].s); 215 freeaddrinfo((void*)dnshandler->socklist->tcp[i].addr); 216 }

            217 }*/
            >>> CID 112202: Resource leaks (RESOURCE_LEAK)
            >>> Variable "tcp_accept_handlers" going out of scope leaks the storage it points to.
            218 }
            219
            220
            221 /**
            222 * Signal dns handler.
            223 *

        • CID 112201: Resource leaks (RESOURCE_LEAK)
          /signer/src/wire/tsig-openssl.c: 79 in tsig_openssl_init_algorithm()

      ________________________________________________________________________________________________________

          • CID 112201: Resource leaks (RESOURCE_LEAK)
            /signer/src/wire/tsig-openssl.c: 79 in tsig_openssl_init_algorithm()
            73 CHECKALLOC(algorithm = (tsig_algo_type *) malloc(sizeof(tsig_algo_type)));
            74 algorithm->txt_name = name;
            75 algorithm->wf_name = ldns_dname_new_frm_str(wireformat);
            76 if (!algorithm->wf_name) { 77 ods_log_error("[%s] unable to parse %s algorithm", tsig_str, 78 wireformat); >>> CID 112201: Resource leaks (RESOURCE_LEAK) >>> Variable "algorithm" going out of scope leaks the storage it points to. 79 return 0; 80 }

            81 algorithm->max_digest_size = EVP_MAX_MD_SIZE;
            82 algorithm->data = hmac_algorithm;
            83 algorithm->hmac_create = create_context;
            84 algorithm->hmac_init = init_context;

        • CID 112200: Resource leaks (RESOURCE_LEAK)
          /signer/src/signer/zone.c: 257 in zone_publish_dnskeys()

      ________________________________________________________________________________________________________

          • CID 112200: Resource leaks (RESOURCE_LEAK)
            /signer/src/signer/zone.c: 257 in zone_publish_dnskeys()
            251 if (!zone->signconf->keys->keys[i].dnskey) {
            252 /* get dnskey */
            253 if (zone->signconf->keys->keys[i].resourcerecord)
            Unknown macro: {254 if ((status = rrset_getliteralrr(&zone->signconf->keys->keys[i].dnskey, zone->signconf->keys->keys[i].resourcerecord, ttl, zone->apex)) != ODS_STATUS_OK) { 255 ods_log_error("[%s] unable to publish dnskeys for zone %s: " 256 "error decoding literal dnskey", zone_str, zone->name); >>> CID 112200: Resource leaks (RESOURCE_LEAK) >>> Variable "ctx" going out of scope leaks the storage it points to. 257 return status; 258 }259 }

            else {
            260 status = lhsm_get_key(ctx, zone->apex,
            261 &zone->signconf->keys->keys[i]);
            262 if (status != ODS_STATUS_OK) {

        • CID 112199: Resource leaks (RESOURCE_LEAK)
          /signer/src/wire/tsig.c: 181 in tsig_key_create()

      ________________________________________________________________________________________________________

          • CID 112199: Resource leaks (RESOURCE_LEAK)
            /signer/src/wire/tsig.c: 181 in tsig_key_create()
            175 if (!tsig || !tsig->name || !tsig->secret) { 176 return NULL; 177 }

            178 CHECKALLOC(key = (tsig_key_type*) malloc(sizeof(tsig_key_type)));
            179 dname = ldns_dname_new_frm_str(tsig->name);
            180 if (!dname)

            { >>> CID 112199: Resource leaks (RESOURCE_LEAK) >>> Variable "key" going out of scope leaks the storage it points to. 181 return NULL; 182 }

            183 CHECKALLOC(data = malloc(sizeof(uint8_t) * util_b64_pton_calculate_size(strlen(tsig->secret))));
            184 size = b64_pton(tsig->secret, data,
            185 util_b64_pton_calculate_size(strlen(tsig->secret)));
            186 if (size < 0) {

      ________________________________________________________________________________________________________
      To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/opendnssec-opendnssec?tab=overview

      To manage Coverity Scan email notifications for "berry@nlnetlabs.nl", click https://scan.coverity.com/subscriptions/edit?email=berry%40nlnetlabs.nl&token=ecba9257e856ad34f6c2a2b30a675690

        Attachments

          Activity

            People

            Assignee:
            berry Berry van Halderen
            Reporter:
            berry Berry van Halderen
            Votes:
            0 Vote for this issue
            Watchers:
            1 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