]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use the return value of isc_portset_create()
authorAram Sargsyan <aram@isc.org>
Wed, 31 Aug 2022 13:18:39 +0000 (13:18 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Fri, 2 Sep 2022 07:40:27 +0000 (07:40 +0000)
There is an omission of assigning the return value coming from the
isc_portset_create() function to the result variable.

CID 356328:

    /bin/named/server.c: 8756 in load_configuration()
    8750            "creating UDP/IPv4 port set: %s",
    8751            isc_result_totext(result));
    8752      goto cleanup_bindkeys_parser;
    8753      }
    8754      isc_portset_create(named_g_mctx, &v6portset);
    8755      if (result != ISC_R_SUCCESS) {
    >>>     CID 356328:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "isc_log_write(named_g_lctx,...".
    8756      isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
    8757            NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
    8758            "creating UDP/IPv6 port set: %s",
    8759            isc_result_totext(result));
    8760      goto cleanup_v4portset;
    8761      }

bin/named/server.c

index 476c408b7858fc0d6e721346838f0e7eb83cb706..fd7426ac7485568be3068251034237d9c03f5394 100644 (file)
@@ -8764,7 +8764,7 @@ load_configuration(const char *filename, named_server_t *server,
                              isc_result_totext(result));
                goto cleanup_bindkeys_parser;
        }
-       isc_portset_create(named_g_mctx, &v6portset);
+       result = isc_portset_create(named_g_mctx, &v6portset);
        if (result != ISC_R_SUCCESS) {
                isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
                              NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,