]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1940. [bug] Fixed a number of error conditions reported by
authorMark Andrews <marka@isc.org>
Wed, 30 Nov 2005 03:44:39 +0000 (03:44 +0000)
committerMark Andrews <marka@isc.org>
Wed, 30 Nov 2005 03:44:39 +0000 (03:44 +0000)
                        Coverity.

42 files changed:
CHANGES
bin/dnssec/dnssec-signzone.c
bin/named/config.c
bin/named/controlconf.c
bin/named/interfacemgr.c
bin/named/lwdgrbn.c
bin/named/lwresd.c
bin/named/query.c
bin/named/server.c
bin/named/zoneconf.c
bin/tests/db/t_db.c
bin/tests/dst/dst_test.c
bin/tests/dst/t_dst.c
bin/tests/master/t_master.c
bin/tests/names/t_names.c
bin/tests/rbt/t_rbt.c
bin/tests/system/tkey/keycreate.c
bin/tests/system/tkey/keydelete.c
bin/tests/tasks/t_tasks.c
lib/dns/acache.c
lib/dns/adb.c
lib/dns/dnssec.c
lib/dns/dst_api.c
lib/dns/lookup.c
lib/dns/master.c
lib/dns/masterdump.c
lib/dns/message.c
lib/dns/opensslrsa_link.c
lib/dns/resolver.c
lib/dns/sdlz.c
lib/dns/tkey.c
lib/dns/tsig.c
lib/dns/validator.c
lib/dns/zone.c
lib/dns/zt.c
lib/isc/lex.c
lib/isc/taskpool.c
lib/isc/timer.c
lib/isc/unix/socket.c
lib/isccfg/parser.c
lib/lwres/getaddrinfo.c
lib/tests/t_api.c

diff --git a/CHANGES b/CHANGES
index 70230cacda7e4c2c9a234c914bd742eaf29c0fa3..cc11506a393d3b9b333be676ce5e14597e8176ed 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1940.  [bug]           Fixed a number of error conditions reported by
+                       Coverity.
+
 1939.  [bug]           The resolver could dereference a null pointer after
                        validation if all the queries have timed out.
                        [RT #15528]
index 2043f7a002f23e125f3fa6bd2a8c0eadbd866df3..f76b6bccc918ab6402734d2316925478b4980776 100644 (file)
@@ -16,7 +16,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-signzone.c,v 1.177.18.14 2005/10/14 01:28:20 marka Exp $ */
+/* $Id: dnssec-signzone.c,v 1.177.18.15 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -1271,10 +1271,6 @@ nsecify(void) {
                                result = dns_dbiterator_next(dbiter);
                                continue;
                        }
-                       if (result != ISC_R_SUCCESS) {
-                               dns_db_detachnode(gdb, &nextnode);
-                               break;
-                       }
                        if (!dns_name_issubdomain(nextname, gorigin) ||
                            (zonecut != NULL &&
                             dns_name_issubdomain(nextname, zonecut)))
index fc66b07c31d1bf3b7ca021fd1fe026adba88af41..528466879f55e86573ef7f517cbb0f31db9e880a 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.c,v 1.47.18.15 2005/09/05 02:30:50 marka Exp $ */
+/* $Id: config.c,v 1.47.18.16 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -448,13 +448,14 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
                if (val > ISC_UINT16_MAX) {
                        cfg_obj_log(portobj, ns_g_lctx, ISC_LOG_ERROR,
                                    "port '%u' out of range", val);
-                       return (ISC_R_RANGE);
+                       result = ISC_R_RANGE;
+                       goto cleanup;
                }
                port = (in_port_t) val;
        } else {
                result = ns_config_getport(config, &port);
                if (result != ISC_R_SUCCESS)
-                       return (result);
+                       goto cleanup;
        }
 
        result = ISC_R_NOMEMORY;
@@ -615,9 +616,9 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
                        if (new == NULL)
                                goto cleanup;
                        memcpy(new, addrs, newsize);
-                       isc_mem_put(mctx, addrs, oldsize);
                } else
                        new = NULL;
+               isc_mem_put(mctx, addrs, oldsize);
                addrs = new;
                addrcount = i;
 
@@ -628,9 +629,9 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
                        if (new == NULL)
                                goto cleanup;
                        memcpy(new, keys,  newsize);
-                       isc_mem_put(mctx, keys, oldsize);
                } else
                        new = NULL;
+               isc_mem_put(mctx, keys, oldsize);
                keys = new;
                keycount = i;
        }
index d6c6df48458514d693739fdf2a8fbdf10efc1e47..c11c4a8e122cc1254590152e9f2a61007dcf3e86 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: controlconf.c,v 1.40.18.5 2005/08/23 02:31:30 marka Exp $ */
+/* $Id: controlconf.c,v 1.40.18.6 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -364,6 +364,9 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
        {
                ccregion.rstart = isc_buffer_base(&conn->ccmsg.buffer);
                ccregion.rend = isc_buffer_used(&conn->ccmsg.buffer);
+               if (secret.rstart != NULL)
+                       isc_mem_put(listener->mctx, secret.rstart,
+                                   REGION_SIZE(secret));
                secret.rstart = isc_mem_get(listener->mctx, key->secret.length);
                if (secret.rstart == NULL)
                        goto cleanup;
@@ -379,8 +382,6 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
                         */
                        if (request != NULL)
                                isccc_sexpr_free(&request);
-                       isc_mem_put(listener->mctx, secret.rstart,
-                                   REGION_SIZE(secret));
                } else {
                        log_invalid(&conn->ccmsg, result);
                        goto cleanup;
@@ -987,18 +988,25 @@ update_listener(ns_controls_t *cp,
                result = get_rndckey(listener->mctx, &listener->keys);
        }
 
-       if (result != ISC_R_SUCCESS && global_keylist != NULL)
+       if (result != ISC_R_SUCCESS && global_keylist != NULL) {
                /*
                 * This message might be a little misleading since the
                 * "new keys" might in fact be identical to the old ones,
                 * but tracking whether they are identical just for the
                 * sake of avoiding this message would be too much trouble.
                 */
-               cfg_obj_log(control, ns_g_lctx, ISC_LOG_WARNING,
-                           "couldn't install new keys for "
-                           "command channel %s: %s",
-                           socktext, isc_result_totext(result));
-
+               if (control != NULL)
+                       cfg_obj_log(control, ns_g_lctx, ISC_LOG_WARNING,
+                                   "couldn't install new keys for "
+                                   "command channel %s: %s",
+                                   socktext, isc_result_totext(result));
+               else
+                       isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+                                     NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
+                                     "couldn't install new keys for "
+                                     "command channel %s: %s",
+                                     socktext, isc_result_totext(result));
+       }
 
        /*
         * Now, keep the old access list unless a new one can be made.
@@ -1016,12 +1024,18 @@ update_listener(ns_controls_t *cp,
                dns_acl_detach(&listener->acl);
                dns_acl_attach(new_acl, &listener->acl);
                dns_acl_detach(&new_acl);
-       } else
                /* XXXDCL say the old acl is still used? */
+       } else if (control != NULL)
                cfg_obj_log(control, ns_g_lctx, ISC_LOG_WARNING,
                            "couldn't install new acl for "
                            "command channel %s: %s",
                            socktext, isc_result_totext(result));
+       else
+               isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+                             NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
+                             "couldn't install new acl for "
+                             "command channel %s: %s",
+                             socktext, isc_result_totext(result));
 
        if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) {
                isc_uint32_t perm, owner, group;
@@ -1037,7 +1051,7 @@ update_listener(ns_controls_t *cp,
                        listener->perm = perm;
                        listener->owner = owner;
                        listener->group = group;
-               } else
+               } else if (control != NULL)
                        cfg_obj_log(control, ns_g_lctx, ISC_LOG_WARNING,
                                    "couldn't update ownership/permission for "
                                    "command channel %s", socktext);
index 31c392e0013c68603e1f1f39cd2c74890186cf5a..cd71e367feb8639d7104f920d83ef0095f945ba5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: interfacemgr.c,v 1.76.18.5 2005/04/27 05:00:30 sra Exp $ */
+/* $Id: interfacemgr.c,v 1.76.18.6 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -766,9 +766,8 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen,
                         * See if the address matches the listen-on statement;
                         * if not, ignore the interface.
                         */
-                       result = dns_acl_match(&listen_netaddr, NULL,
-                                              le->acl, &mgr->aclenv,
-                                              &match, NULL);
+                       (void)dns_acl_match(&listen_netaddr, NULL, le->acl,
+                                           &mgr->aclenv, &match, NULL);
                        if (match <= 0)
                                continue;
 
@@ -799,9 +798,9 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen,
                                for (ele = ISC_LIST_HEAD(ext_listen->elts);
                                     ele != NULL;
                                     ele = ISC_LIST_NEXT(ele, link)) {
-                                       dns_acl_match(&listen_netaddr, NULL,
-                                                     ele->acl, NULL,
-                                                     &match, NULL);
+                                       (void)dns_acl_match(&listen_netaddr,
+                                                           NULL, ele->acl,
+                                                           NULL, &match, NULL);
                                        if (match > 0 && ele->port == le->port)
                                                break;
                                        else
index 6d389f21394057efe2a036636f58900097aea76e..a73f2403903f758bb80f338857095daf5e5c761c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwdgrbn.c,v 1.13.18.2 2005/04/29 00:15:24 marka Exp $ */
+/* $Id: lwdgrbn.c,v 1.13.18.3 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -360,7 +360,7 @@ lookup_done(isc_task_t *task, isc_event_t *event) {
        client->sendlength = r.length;
        result = ns_lwdclient_sendreply(client, &r);
        if (result != ISC_R_SUCCESS)
-               goto out;
+               goto out2;
 
        NS_LWDCLIENT_SETSEND(client);
 
@@ -380,7 +380,7 @@ lookup_done(isc_task_t *task, isc_event_t *event) {
        if (grbn->siglen != NULL)
                isc_mem_put(cm->mctx, grbn->siglen,
                            grbn->nsigs * sizeof(lwres_uint16_t));
-
+ out2:
        if (client->lookup != NULL)
                dns_lookup_destroy(&client->lookup);
        if (lwb.base != NULL)
index 174fa8b347b396bf305060217f18e2ca24bbc763..93773b81a1bd9fbfc71a483908261e0bab8b62d6 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwresd.c,v 1.46.18.4 2005/08/23 02:31:33 marka Exp $ */
+/* $Id: lwresd.c,v 1.46.18.5 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file 
  * \brief
@@ -408,6 +408,7 @@ ns_lwdmanager_create(isc_mem_t *mctx, cfg_obj_t *lwres,
                ns_lwsearchlist_detach(&lwresd->search);
        if (lwresd->mctx != NULL)
                isc_mem_detach(&lwresd->mctx);
+       isc_mem_put(mctx, lwresd, sizeof(ns_lwresd_t));
        return (result);
 }
 
index 0a8560504e9ae3c2533eae5146770b0ee0bff265..309be4a3d29bac4a539bb7d11f1ecb12f3f85e65 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.257.18.19 2005/11/02 01:37:35 marka Exp $ */
+/* $Id: query.c,v 1.257.18.20 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -3270,7 +3270,9 @@ warn_rfc1918(ns_client_t *client, dns_name_t *fname, dns_rdataset_t *rdataset) {
                        result = dns_rdataset_first(&found);
                        RUNTIME_CHECK(result == ISC_R_SUCCESS);
                        dns_rdataset_current(&found, &rdata);
-                       dns_rdata_tostruct(&rdata, &soa, NULL);
+                       result = dns_rdata_tostruct(&rdata, &soa, NULL);
+                       if (result != ISC_R_SUCCESS)
+                               return;
                        if (dns_name_equal(&soa.origin, &prisoner) &&
                            dns_name_equal(&soa.contact, &hostmaster)) {
                                char buf[DNS_NAME_FORMATSIZE];
index 16c4188cf9b31df762b794b74afc6aa0df476317..9588cdf17d28a696266c9dbab599d6c244824fe5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.419.18.32 2005/09/05 00:18:11 marka Exp $ */
+/* $Id: server.c,v 1.419.18.33 2005/11/30 03:44:38 marka Exp $ */
 
 /*! \file */
 
@@ -277,7 +277,7 @@ configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
        }
        maps[i] = NULL;
 
-       result = ns_config_get(maps, aclname, &aclobj);
+       (void)ns_config_get(maps, aclname, &aclobj);
        if (aclobj == NULL)
                /*
                 * No value available.  *aclp == NULL.
@@ -496,7 +496,6 @@ get_view_querysource_dispatch(cfg_obj_t **maps,
        case AF_INET:
                result = ns_config_get(maps, "query-source", &obj);
                INSIST(result == ISC_R_SUCCESS);
-
                break;
        case AF_INET6:
                result = ns_config_get(maps, "query-source-v6", &obj);
@@ -905,7 +904,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
         * unless explicitly disabled.
         */
        obj = NULL;
-       ns_config_get(maps, "use-additional-cache", &obj);
+       (void)ns_config_get(maps, "use-additional-cache", &obj);
        if (obj == NULL || cfg_obj_asboolean(obj)) {
                cmctx = NULL;
                CHECK(isc_mem_create(0, 0, &cmctx));
@@ -1282,7 +1281,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
         * Configure the "match-recursive-only" option.
         */
        obj = NULL;
-       (void) ns_config_get(maps, "match-recursive-only", &obj);
+       (void)ns_config_get(maps, "match-recursive-only", &obj);
        if (obj != NULL && cfg_obj_asboolean(obj))
                view->matchrecursiveonly = ISC_TRUE;
        else
@@ -2249,8 +2248,7 @@ add_listenelt(isc_mem_t *mctx, ns_listenlist_t *list, isc_sockaddr_t *addr) {
 
  clean:
        INSIST(lelt == NULL);
-       if (src_acl != NULL)
-               dns_acl_detach(&src_acl);
+       dns_acl_detach(&src_acl);
 
        return (result);
 }
@@ -4229,6 +4227,11 @@ ns_server_dumpdb(ns_server_t *server, char *args) {
        char *ptr;
        const char *sep;
 
+       /* Skip the command name. */
+       ptr = next_token(&args, " \t");
+       if (ptr == NULL)
+               return (ISC_R_UNEXPECTEDEND);
+
        dctx = isc_mem_get(server->mctx, sizeof(*dctx));
        if (dctx == NULL)
                return (ISC_R_NOMEMORY);
@@ -4251,11 +4254,6 @@ ns_server_dumpdb(ns_server_t *server, char *args) {
        CHECKMF(isc_stdio_open(server->dumpfile, "w", &dctx->fp),
                "could not open dump file", server->dumpfile);
 
-       /* Skip the command name. */
-       ptr = next_token(&args, " \t");
-       if (ptr == NULL)
-               return (ISC_R_UNEXPECTEDEND);
-
        sep = (args == NULL) ? "" : ": ";
        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
                      NS_LOGMODULE_SERVER, ISC_LOG_INFO,
index 8a124555725baff0e06face7624405a0b973241a..34d54dbde0aee76d038c214aa8ddcbc74ccab35e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zoneconf.c,v 1.110.18.14 2005/08/25 00:05:43 marka Exp $ */
+/* $Id: zoneconf.c,v 1.110.18.15 2005/11/30 03:44:38 marka Exp $ */
 
 /*% */
 
@@ -730,6 +730,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
        switch (ztype) {
        case dns_zone_slave:
        case dns_zone_stub:
+               count = 0;
                obj = NULL;
                result = cfg_map_get(zoptions, "masters", &obj);
                if (obj != NULL) {
index 747cacc9804ab1bb4b7be970b812a559d6d3bda5..60bb24db4bb68d8a93774c662ec903211b86c1e1 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_db.c,v 1.31.18.1 2004/10/25 01:32:24 marka Exp $ */
+/* $Id: t_db.c,v 1.31.18.2 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -403,8 +403,10 @@ test_dns_db_zc_x(const char *filename, dns_dbtype_t dbtype,
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, tokens);
                        if (cnt == 4) {
index ddc99e3b567aa7086515676166ed96f4129586ba..89f2a33a39bbebb456b3bb8f4f07442781e24e3f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dst_test.c,v 1.38.18.1 2004/06/11 00:30:11 marka Exp $ */
+/* $Id: dst_test.c,v 1.38.18.2 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -236,23 +236,34 @@ main(void) {
        isc_buffer_t b;
        dns_fixedname_t fname;
        dns_name_t *name;
+       isc_result_t result;
 
-       isc_mem_create(0, 0, &mctx);
+       result = isc_mem_create(0, 0, &mctx);
+       if (result != ISC_R_SUCCESS)
+               return (1);
 
        current = isc_mem_get(mctx, 256);
+       if (current == NULL)
+               return (1);
        getcwd(current, 256);
 
        dns_result_register();
 
-       isc_entropy_create(mctx, &ectx);
-       isc_entropy_createfilesource(ectx, "randomfile");
+       result = isc_entropy_create(mctx, &ectx);
+       if (result != ISC_R_SUCCESS)
+               return (1);
+       result = isc_entropy_createfilesource(ectx, "randomfile");
+       if (result != ISC_R_SUCCESS)
+               return (1);
        dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING|ISC_ENTROPY_GOODONLY);
 
        dns_fixedname_init(&fname);
        name = dns_fixedname_name(&fname);
        isc_buffer_init(&b, "test.", 5);
        isc_buffer_add(&b, 5);
-       dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       result = dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       if (result != ISC_R_SUCCESS)
+               return (1);
        io(name, 23616, DST_ALG_DSA, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, mctx);
        io(name, 54622, DST_ALG_RSAMD5, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
           mctx);
@@ -262,7 +273,9 @@ main(void) {
 
        isc_buffer_init(&b, "dh.", 3);
        isc_buffer_add(&b, 3);
-       dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       result = dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       if (result != ISC_R_SUCCESS)
+               return (1);
        dh(name, 18602, name, 48957, mctx);
 
        generate(DST_ALG_RSAMD5, mctx);
index 8e21d5e22be720a4bae84a185d43d16680a3407b..87aff374066d7bd57ecd76f46169f368f2d92f86 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_dst.c,v 1.48.18.1 2004/06/11 00:30:11 marka Exp $ */
+/* $Id: t_dst.c,v 1.48.18.2 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -405,7 +405,13 @@ t1(void) {
        name = dns_fixedname_name(&fname);
        isc_buffer_init(&b, "test.", 5);
        isc_buffer_add(&b, 5);
-       dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       isc_result = dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       if (isc_result != ISC_R_SUCCESS) {
+               t_info("dns_name_fromtext failed %s\n",
+                      isc_result_totext(isc_result));
+               t_result(T_UNRESOLVED);
+               return;
+       }
        io(name, 23616, DST_ALG_DSA, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
                        mctx, ISC_R_SUCCESS, &nfails, &nprobs);
        t_info("testing use of stored keys [2]\n");
@@ -421,7 +427,13 @@ t1(void) {
 
        isc_buffer_init(&b, "dh.", 3);
        isc_buffer_add(&b, 3);
-       dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       isc_result = dns_name_fromtext(name, &b, NULL, ISC_FALSE, NULL);
+       if (isc_result != ISC_R_SUCCESS) {
+               t_info("dns_name_fromtext failed %s\n",
+                      isc_result_totext(isc_result));
+               t_result(T_UNRESOLVED);
+               return;
+       }
 
        dh(name, 18602, name, 48957, mctx, ISC_R_SUCCESS, &nfails, &nprobs);
 
@@ -674,7 +686,14 @@ t2_sigchk(char *datapath, char *sigpath, char *keyname,
        name = dns_fixedname_name(&fname);
        isc_buffer_init(&b, keyname, strlen(keyname));
        isc_buffer_add(&b, strlen(keyname));
-       dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL);
+       isc_result = dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL);
+       if (isc_result != ISC_R_SUCCESS) {
+               t_info("dns_name_fromtext failed %s\n",
+                       isc_result_totext(isc_result));
+               (void) free(data);
+               ++*nprobs;
+               return;
+       }
        isc_result = dst_key_fromfile(name, id, alg, type, NULL, mctx, &key);
        if (isc_result != ISC_R_SUCCESS) {
                t_info("dst_key_fromfile failed %s\n",
index 20b0548e9ba5c8e2766018f1a777f31a77450c62..806bf70be20322992591efa39fb89794d68a2091 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_master.c,v 1.32 2004/03/05 04:58:49 marka Exp $ */
+/* $Id: t_master.c,v 1.32.18.1 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -153,8 +153,10 @@ test_master_x(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace(*p & 0xff)) || (*p == '#'))
+                       if ((isspace(*p & 0xff)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        /*
                         * Name of data file, origin, zclass, expected result.
index 90ece31962c5fabf035c7c3ccdd2e88bb00207eb..54a8d25178ca2c41f362fee02f12992a8a1ed506 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_names.c,v 1.36.18.2 2005/04/29 00:15:46 marka Exp $ */
+/* $Id: t_names.c,v 1.36.18.3 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -568,8 +568,10 @@ t_dns_name_isabsolute(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 2) {
@@ -679,8 +681,10 @@ t_dns_name_hash(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 4) {
@@ -833,8 +837,10 @@ t_dns_name_fullcompare(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 6) {
@@ -951,8 +957,10 @@ t_dns_name_compare(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 3) {
@@ -1051,8 +1059,10 @@ t_dns_name_rdatacompare(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 3) {
@@ -1147,8 +1157,10 @@ t_dns_name_issubdomain(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 3) {
@@ -1228,8 +1240,10 @@ t_dns_name_countlabels(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 2) {
@@ -1338,8 +1352,10 @@ t_dns_name_getlabel(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 4) {
@@ -1466,8 +1482,10 @@ t_dns_name_getlabelsequence(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 5) {
@@ -1554,8 +1572,10 @@ t_dns_name_fromregion(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 1) {
@@ -1602,8 +1622,10 @@ t_dns_name_toregion(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 1) {
@@ -1737,8 +1759,10 @@ t_dns_name_fromtext(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 4) {
@@ -1871,8 +1895,10 @@ t_dns_name_totext(void) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 2) {
@@ -2030,8 +2056,10 @@ t_dns_name_fromwire_x(const char *testfile, size_t buflen) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 6) {
@@ -2223,8 +2251,10 @@ t_dns_name_towire_x(const char *testfile, size_t buflen) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = bustline(p, Tokens);
                        if (cnt == 5) {
index 49428936e0941a2d1d92cc9e3436254efcd0e7d7..037db9cdd4f4eade03b4a93d575352b1c6ac050b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_rbt.c,v 1.25.18.1 2004/10/25 01:32:25 marka Exp $ */
+/* $Id: t_rbt.c,v 1.25.18.2 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -127,6 +127,7 @@ create_name(char *s, isc_mem_t *mctx, dns_name_t **dns_name) {
        isc_result_t    result;
        isc_buffer_t    source;
        isc_buffer_t    target;
+       dns_name_t      *name;
 
        nfails = 0;
 
@@ -141,22 +142,26 @@ create_name(char *s, isc_mem_t *mctx, dns_name_t **dns_name) {
                 * The buffer for the actual name will immediately follow the
                 * name structure.
                 */
-               *dns_name = isc_mem_get(mctx, sizeof(**dns_name) + DNSNAMELEN);
-               if (*dns_name == NULL) {
+               name = isc_mem_get(mctx, sizeof(*name) + DNSNAMELEN);
+               if (name == NULL) {
                        t_info("isc_mem_get failed\n");
                        ++nfails;
-               }
+               } else {
 
-               dns_name_init(*dns_name, NULL);
-               isc_buffer_init(&target, *dns_name + 1, DNSNAMELEN);
+                       dns_name_init(name, NULL);
+                       isc_buffer_init(&target, name + 1, DNSNAMELEN);
 
-               result = dns_name_fromtext(*dns_name, &source, dns_rootname,
-                                          ISC_FALSE, &target);
+                       result = dns_name_fromtext(name, &source, dns_rootname,
+                                                  ISC_FALSE, &target);
 
-               if (result != ISC_R_SUCCESS) {
-                       ++nfails;
-                       t_info("dns_name_fromtext(%s) failed %s\n",
-                              s, dns_result_totext(result));
+                       if (result != ISC_R_SUCCESS) {
+                               ++nfails;
+                               t_info("dns_name_fromtext(%s) failed %s\n",
+                                      s, dns_result_totext(result));
+                                isc_mem_put(mctx, name,
+                                            sizeof(*name) + DNSNAMELEN);
+                       } else
+                               *dns_name = name;
                }
        } else {
                ++nfails;
@@ -182,15 +187,17 @@ t1_add(char *name, dns_rbt_t *rbt, isc_mem_t *mctx, isc_result_t *dns_result) {
 
        nprobs = 0;
        if (name && dns_result) {
-               *dns_result = create_name(name, mctx, &dns_name);
-               if (*dns_result == ISC_R_SUCCESS) {
+               if (create_name(name, mctx, &dns_name) == 0) {
                        if (T_debug)
                                t_info("dns_rbt_addname succeeded\n");
                        *dns_result = dns_rbt_addname(rbt, dns_name, dns_name);
+                       if (*dns_result != ISC_R_SUCCESS) {
+                               delete_name(dns_name, mctx);
+                               t_info("dns_rbt_addname failed %s\n",
+                                      dns_result_totext(*dns_result));
+                               ++nprobs;
+                       }
                } else {
-                       t_info("dns_rbt_addname failed %s\n",
-                                       dns_result_totext(*dns_result));
-                       delete_name(dns_name, mctx);
                        ++nprobs;
                }
        } else {
@@ -208,8 +215,7 @@ t1_delete(char *name, dns_rbt_t *rbt, isc_mem_t *mctx,
 
        nprobs = 0;
        if (name && dns_result) {
-               *dns_result = create_name(name, mctx, &dns_name);
-               if (*dns_result == ISC_R_SUCCESS) {
+               if (create_name(name, mctx, &dns_name) == 0) {
                        *dns_result = dns_rbt_deletename(rbt, dns_name,
                                                         ISC_FALSE);
                        delete_name(dns_name, mctx);
@@ -234,8 +240,7 @@ t1_search(char *name, dns_rbt_t *rbt, isc_mem_t *mctx,
 
        nprobs = 0;
        if (name && dns_result) {
-               *dns_result = create_name(name, mctx, &dns_searchname);
-               if (*dns_result == ISC_R_SUCCESS) {
+               if (create_name(name, mctx, &dns_searchname) == 0) {
                        dns_fixedname_init(&dns_fixedname);
                        dns_foundname = dns_fixedname_name(&dns_fixedname);
                        data = NULL;
@@ -281,7 +286,7 @@ rbt_init(char *filename, dns_rbt_t **rbt, isc_mem_t *mctx) {
                 * Skip any comment lines.
                 */
                if ((*p == '#') || (*p == '\0') || (*p == ' ')) {
-                       free(p);
+                       (void)free(p);
                        continue;
                }
 
@@ -362,8 +367,7 @@ test_rbt_gen(char *filename, char *command, char *testname,
        if (strcmp(command, "create") == 0) {
                result = T_PASS;
        } else if (strcmp(command, "add") == 0) {
-               dns_result = create_name(testname, mctx, &dns_name);
-               if (dns_result == ISC_R_SUCCESS) {
+               if (create_name(testname, mctx, &dns_name) == 0) {
                        dns_result = dns_rbt_addname(rbt, dns_name, dns_name);
 
                        if (dns_result != ISC_R_SUCCESS)
@@ -466,8 +470,10 @@ test_dns_rbt_x(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        /*
                         * Name of db file, command, testname,
@@ -976,8 +982,10 @@ test_dns_rbtnodechain_init(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, Tokens);
                        if (cnt == 10) {
@@ -1163,8 +1171,10 @@ test_dns_rbtnodechain_first(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, Tokens);
                        if (cnt == 5) {
@@ -1354,8 +1364,10 @@ test_dns_rbtnodechain_last(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, Tokens);
                        if (cnt == 5) {
@@ -1560,8 +1572,10 @@ test_dns_rbtnodechain_next(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, Tokens);
                        if (cnt == 4) {
@@ -1765,8 +1779,10 @@ test_dns_rbtnodechain_prev(const char *filename) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, Tokens);
                        if (cnt == 4) {
index e417e72c1cfd76ef13ec32b4890267dd79c37fcb..6936caecd4eea7cf1e7ed15de25373e7d2360e8f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: keycreate.c,v 1.10.18.1 2004/06/11 00:30:12 marka Exp $ */
+/* $Id: keycreate.c,v 1.10.18.2 2005/11/30 03:44:38 marka Exp $ */
 
 #include <config.h>
 
@@ -144,7 +144,9 @@ sendquery(isc_task_t *task, isc_event_t *event) {
 
        isc_event_free(&event);
 
-       inet_pton(AF_INET, "10.53.0.1", &inaddr);
+       result = ISC_R_FAILURE;
+       if (inet_pton(AF_INET, "10.53.0.1", &inaddr) != 1)
+               CHECK("inet_pton", result);
        isc_sockaddr_fromin(&address, &inaddr, PORT);
 
        dns_fixedname_init(&keyname);
index 88ad2716befee10ccd3823d741927f012cb47ec5..18b97f163189aa7d8df4beba18013b9580ef2341 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: keydelete.c,v 1.6.18.1 2004/06/11 00:30:12 marka Exp $ */
+/* $Id: keydelete.c,v 1.6.18.2 2005/11/30 03:44:39 marka Exp $ */
 
 #include <config.h>
 
@@ -118,7 +118,9 @@ sendquery(isc_task_t *task, isc_event_t *event) {
 
        isc_event_free(&event);
 
-       inet_pton(AF_INET, "10.53.0.1", &inaddr);
+       result = ISC_R_FAILURE;
+       if (inet_pton(AF_INET, "10.53.0.1", &inaddr) != 1)
+               CHECK("inet_pton", result);
        isc_sockaddr_fromin(&address, &inaddr, PORT);
 
        query = NULL;
index 2bd8455cd1ed3ebc834dcbcce907c9f3a1d771fe..45f903974b3b1c6d2c86b82b8413fa30df2e641c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_tasks.c,v 1.32.18.5 2005/07/19 06:20:19 marka Exp $ */
+/* $Id: t_tasks.c,v 1.32.18.6 2005/11/30 03:44:39 marka Exp $ */
 
 #include <config.h>
 
@@ -2131,6 +2131,7 @@ t13(void) {
 #define T14_NTASKS 10
 #define T14_EXCLTASK 6
 
+int t14_exclusiveerror = ISC_R_SUCCESS;
 int t14_error = 0;
 int t14_done = 0;
 
@@ -2146,8 +2147,12 @@ t14_callback(isc_task_t *task, isc_event_t *event) {
        t_info("task enter %d\n", taskno);      
        if (taskno == T14_EXCLTASK) {
                int     i;
-               isc_task_beginexclusive(task);
-               t_info("task %d got exclusive access\n", taskno);                       
+               t14_exclusiveerror = isc_task_beginexclusive(task);
+               if (t14_exclusiveerror == ISC_R_SUCCESS)
+                       t_info("task %d got exclusive access\n", taskno);
+               else
+                       t_info("task %d failed to got exclusive access: %d\n",
+                               taskno, t14_exclusiveerror);
                for (i = 0; i < T14_NTASKS; i++) {
                        t_info("task %d state %d\n", i , t14_active[i]);
                        if (t14_active[i])
@@ -2251,8 +2256,11 @@ t_tasks14(void) {
 
        isc_taskmgr_destroy(&manager);
 
-       if (t14_error) {
-               t_info("mutual access occurred\n");
+       if (t14_exclusiveerror != ISC_R_SUCCESS || t14_error) {
+               if (t14_exclusiveerror != ISC_R_SUCCESS)
+                       t_info("isc_task_beginexclusive() failed\n");
+               if (t14_error)
+                       t_info("mutual access occurred\n");
                return(T_FAIL);
        }
 
index d93619085e98493c93ecc065444c992a481b1252..76cefdf37d9c86e450301fed0a514f8b4f78afb4 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: acache.c,v 1.3.2.8 2005/07/12 01:22:18 marka Exp $ */
+/* $Id: acache.c,v 1.3.2.9 2005/11/30 03:44:39 marka Exp $ */
 
 #include <config.h>
 
@@ -1235,7 +1235,12 @@ dns_acache_createentry(dns_acache_t *acache, dns_db_t *origdb,
                return (result);
        };
 
-       isc_refcount_init(&newentry->references, 1);
+       result = isc_refcount_init(&newentry->references, 1);
+       if (result != ISC_R_SUCCESS) {
+               ACACHE_DESTROYLOCK(&newentry->lock);
+               isc_mem_put(acache->mctx, newentry, sizeof(*newentry));
+               return (result);
+       };
 
        ISC_LINK_INIT(newentry, link);
        ISC_LINK_INIT(newentry, olink);
index 403fa3b3a42910e45480486dea4000e065e1752d..e1c5b0ad30996c98dd65cdefef3be7e7d303e717 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: adb.c,v 1.215.18.10 2005/10/14 05:26:54 marka Exp $ */
+/* $Id: adb.c,v 1.215.18.11 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file 
  *
@@ -2594,8 +2594,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
                }
        }
 
-       if (bucket != DNS_ADB_INVALIDBUCKET)
-               UNLOCK(&adb->namelocks[bucket]);
+       UNLOCK(&adb->namelocks[bucket]);
 
        return (result);
 }
index 3763654cae67028aee5b7a292392bccde7b52bff..fda70489cf947ff8df6702df2b046de2080a5451 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /*
- * $Id: dnssec.c,v 1.81.18.3 2005/04/29 00:15:50 marka Exp $
+ * $Id: dnssec.c,v 1.81.18.4 2005/11/30 03:44:39 marka Exp $
  */
 
 /*! \file */
@@ -331,8 +331,7 @@ cleanup_array:
 cleanup_context:
        dst_context_destroy(&ctx);
 cleanup_databuf:
-       if (databuf != NULL)
-               isc_buffer_free(&databuf);
+       isc_buffer_free(&databuf);
 cleanup_signature:
        isc_mem_put(mctx, sig.signature, sig.siglen);
 
index 552065bb1b46fc0215136eab9b7e4fa278b11743..dee48364aca00562fe2942b7a1dcb93192a338af 100644 (file)
@@ -18,7 +18,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.1.6.4 2005/06/17 02:27:13 marka Exp $
+ * $Id: dst_api.c,v 1.1.6.5 2005/11/30 03:44:39 marka Exp $
  */
 
 /*! \file */
@@ -416,6 +416,7 @@ dst_key_fromnamedfile(const char *filename, int type, isc_mem_t *mctx,
 
        result = dst_key_read_public(newfilename, type, mctx, &pubkey);
        isc_mem_put(mctx, newfilename, newfilenamelen);
+       newfilename = NULL;
        if (result != ISC_R_SUCCESS)
                return (result);
 
@@ -1039,8 +1040,10 @@ write_public_key(const dst_key_t *key, int type, const char *directory) {
        }
 
        ret = dns_name_print(key->key_name, fp);
-       if (ret != ISC_R_SUCCESS)
+       if (ret != ISC_R_SUCCESS) {
+               fclose(fp);
                return (ret);
+       }
 
        fprintf(fp, " ");
 
index 6156094033c8bd40cd7f8c4a7211df7c9cbe696f..642a43450b47285882df1f7973e29d6fde47bd13 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lookup.c,v 1.14.18.3 2005/04/29 00:15:58 marka Exp $ */
+/* $Id: lookup.c,v 1.14.18.4 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -156,11 +156,6 @@ build_event(dns_lookup_t *lookup) {
                        dns_rdataset_disassociate(rdataset);
                isc_mem_put(lookup->mctx, rdataset, sizeof(dns_rdataset_t));
        }
-       if (sigrdataset != NULL) {
-               if (dns_rdataset_isassociated(sigrdataset))
-                       dns_rdataset_disassociate(sigrdataset);
-               isc_mem_put(lookup->mctx, sigrdataset, sizeof(dns_rdataset_t));
-       }
        return (result);
 }
 
@@ -231,13 +226,14 @@ lookup_find(dns_lookup_t *lookup, dns_fetchevent_t *event) {
                                        send_event = ISC_TRUE;
                                goto done;
                        }
-               } else {
+               } else if (event != NULL) {
                        result = event->result;
                        fname = dns_fixedname_name(&event->foundname);
                        dns_resolver_destroyfetch(&lookup->fetch);
                        INSIST(event->rdataset == &lookup->rdataset);
                        INSIST(event->sigrdataset == &lookup->sigrdataset);
-               }
+               } else
+                       fname = NULL;   /* Silence compiler warning. */
 
                /*
                 * If we've been canceled, forget about the result.
index 83c2e83b21adca7abe99f66156c7e925da674dac..82364f4aa43ceeb15d473a172509b5b3e0a4869f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: master.c,v 1.148.18.10 2005/09/01 03:04:27 marka Exp $ */
+/* $Id: master.c,v 1.148.18.11 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -2172,6 +2172,10 @@ load_raw(dns_loadctx_t *lctx) {
                rdatalist.covers = isc_buffer_getuint16(&target);
                rdatalist.ttl =  isc_buffer_getuint32(&target);
                rdcount = isc_buffer_getuint32(&target);
+               if (rdcount == 0) {
+                       result = ISC_R_RANGE;
+                       goto cleanup;
+               }
                INSIST(isc_buffer_consumedlength(&target) <= readlen);
 
                /* Owner name: length followed by name */
index fa315deb8a1d9ae56843596d9a2efcca432d111d..4c3e21f19b97cd6d10fb0097b0405e5c909e1e5b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: masterdump.c,v 1.73.18.9 2005/10/21 03:19:35 marka Exp $ */
+/* $Id: masterdump.c,v 1.73.18.10 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -1448,9 +1448,8 @@ dns_master_dumptostreaminc(isc_mem_t *mctx, dns_db_t *db,
                dns_dumpctx_attach(dctx, dctxp);
                return (DNS_R_CONTINUE);
        }
-       if (dctx != NULL)
-               dns_dumpctx_detach(&dctx);
 
+       dns_dumpctx_detach(&dctx);
        return (result);
 }
 
index 194db02f09a81282ff4a5241697ce6303ba866c5..94e1debb0b0e68aabb1022892c5c55767c16d3e8 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: message.c,v 1.222.18.5 2005/06/07 01:43:52 marka Exp $ */
+/* $Id: message.c,v 1.222.18.6 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -808,6 +808,7 @@ dns_message_findtype(dns_name_t *name, dns_rdatatype_t type,
 {
        dns_rdataset_t *curr;
 
+       REQUIRE(name != NULL);
        if (rdataset != NULL) {
                REQUIRE(*rdataset == NULL);
        }
index f75513e5d331f8d0998ef0c3067d5ce844e08326..87cbb9eb7c3673f78631128714bdcc54352f332e 100644 (file)
@@ -17,7 +17,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: opensslrsa_link.c,v 1.1.6.4 2005/06/17 02:27:14 marka Exp $
+ * $Id: opensslrsa_link.c,v 1.1.6.5 2005/11/30 03:44:39 marka Exp $
  */
 #ifdef OPENSSL
 
@@ -87,12 +87,16 @@ opensslrsa_createctx(dst_key_t *key, dst_context_t *dctx) {
                isc_md5_t *md5ctx;
 
                md5ctx = isc_mem_get(dctx->mctx, sizeof(isc_md5_t));
+               if (md5ctx == NULL)
+                       return (ISC_R_NOMEMORY);
                isc_md5_init(md5ctx);
                dctx->opaque = md5ctx;
        } else {
                isc_sha1_t *sha1ctx;
 
                sha1ctx = isc_mem_get(dctx->mctx, sizeof(isc_sha1_t));
+               if (sha1ctx == NULL)
+                       return (ISC_R_NOMEMORY);
                isc_sha1_init(sha1ctx);
                dctx->opaque = sha1ctx;
        }
index e9581f4ad320a6e05bb42753ef3bd053c69e4811..21f1bdec8711eabf8abe1eeb1e1159c0c72e7ed1 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.284.18.35 2005/11/03 00:57:59 marka Exp $ */
+/* $Id: resolver.c,v 1.284.18.36 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -3309,6 +3309,7 @@ validated(isc_task_t *task, isc_event_t *event) {
                result = dns_rdataset_addnoqname(vevent->rdataset,
                                   vevent->proofs[DNS_VALIDATOR_NOQNAMEPROOF]);
                RUNTIME_CHECK(result == ISC_R_SUCCESS);
+               INSIST(vevent->sigrdataset != NULL);
                vevent->sigrdataset->ttl = vevent->rdataset->ttl;
        }
 
index 6acbb7f53eb366dfdda3f5ce8e74f015138d6bd1..88273a38d0d66622cc0afb0d006af5b537080878 100644 (file)
@@ -50,7 +50,7 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sdlz.c,v 1.2.2.4 2005/11/02 23:29:50 marka Exp $ */
+/* $Id: sdlz.c,v 1.2.2.5 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -1471,7 +1471,7 @@ dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
        dns_rdatatype_t typeval;
        isc_consttextregion_t r;
        isc_buffer_t b;
-       isc_buffer_t *rdatabuf;
+       isc_buffer_t *rdatabuf = NULL;
        isc_lex_t *lex;
        isc_result_t result;
        unsigned int size;
index 4107229066806fdb775459d77361749c75c91e3a..e4dbdc7bf2485202f52c2bfc66823557bfcb429d 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /*
- * $Id: tkey.c,v 1.76.18.4 2005/06/10 07:03:25 marka Exp $
+ * $Id: tkey.c,v 1.76.18.5 2005/11/30 03:44:39 marka Exp $
  */
 /*! \file */
 #include <config.h>
@@ -441,15 +441,17 @@ process_gsstkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name,
                                           dstkey, ISC_TRUE, signer,
                                           tkeyin->inception, tkeyin->expire,
                                           msg->mctx, ring, NULL);
+#if 1
        if (result != ISC_R_SUCCESS)
                goto failure;
-
+#else
        if (result == ISC_R_NOTFOUND) {
                tkeyout->error = dns_tsigerror_badalg;
                return (ISC_R_SUCCESS);
        }
        if (result != ISC_R_SUCCESS)
                goto failure;
+#endif
 
        /* This key is good for a long time */
        isc_stdtime_get(&now);
index 9b94284d61008a35706ea10f89678b2745c42e6b..02ca7365d6fe8a8fd47f1b89e5dd8e8357268b09 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /*
- * $Id: tsig.c,v 1.117.18.4 2005/07/12 01:22:25 marka Exp $
+ * $Id: tsig.c,v 1.117.18.5 2005/11/30 03:44:39 marka Exp $
  */
 /*! \file */
 #include <config.h>
@@ -378,7 +378,7 @@ dns_tsig_sign(dns_message_t *msg) {
        isc_buffer_t databuf, sigbuf;
        isc_buffer_t *dynbuf;
        dns_name_t *owner;
-       dns_rdata_t *rdata;
+       dns_rdata_t *rdata = NULL;
        dns_rdatalist_t *datalist;
        dns_rdataset_t *dataset;
        isc_region_t r;
@@ -570,7 +570,6 @@ dns_tsig_sign(dns_message_t *msg) {
                tsig.signature = NULL;
        }
 
-       rdata = NULL;
        ret = dns_message_gettemprdata(msg, &rdata);
        if (ret != ISC_R_SUCCESS)
                goto cleanup_signature;
@@ -592,7 +591,7 @@ dns_tsig_sign(dns_message_t *msg) {
        owner = NULL;
        ret = dns_message_gettempname(msg, &owner);
        if (ret != ISC_R_SUCCESS)
-               goto cleanup_dynbuf;
+               goto cleanup_context;
        dns_name_init(owner, NULL);
        ret = dns_name_dup(&key->name, msg->mctx, owner);
        if (ret != ISC_R_SUCCESS)
@@ -602,16 +601,16 @@ dns_tsig_sign(dns_message_t *msg) {
        ret = dns_message_gettemprdatalist(msg, &datalist);
        if (ret != ISC_R_SUCCESS)
                goto cleanup_owner;
+       dataset = NULL;
+       ret = dns_message_gettemprdataset(msg, &dataset);
+       if (ret != ISC_R_SUCCESS)
+               goto cleanup_rdatalist;
        datalist->rdclass = dns_rdataclass_any;
        datalist->type = dns_rdatatype_tsig;
        datalist->covers = 0;
        datalist->ttl = 0;
        ISC_LIST_INIT(datalist->rdata);
        ISC_LIST_APPEND(datalist->rdata, rdata, link);
-       dataset = NULL;
-       ret = dns_message_gettemprdataset(msg, &dataset);
-       if (ret != ISC_R_SUCCESS)
-               goto cleanup_owner;
        dns_rdataset_init(dataset);
        RUNTIME_CHECK(dns_rdatalist_tordataset(datalist, dataset)
                      == ISC_R_SUCCESS);
@@ -620,18 +619,22 @@ dns_tsig_sign(dns_message_t *msg) {
 
        return (ISC_R_SUCCESS);
 
-cleanup_owner:
-       if (owner != NULL)
-               dns_message_puttempname(msg, &owner);
-cleanup_dynbuf:
-       if (dynbuf != NULL)
-               isc_buffer_free(&dynbuf);
-cleanup_signature:
+ cleanup_rdatalist:
+       dns_message_puttemprdatalist(msg, &datalist);
+ cleanup_owner:
+       dns_message_puttempname(msg, &owner);
+       goto cleanup_context;
+
+ cleanup_dynbuf:
+       isc_buffer_free(&dynbuf);
+ cleanup_signature:
        if (tsig.signature != NULL)
                isc_mem_put(mctx, tsig.signature, sigsize);
-cleanup_context:
-       if (ctx != NULL)
-               dst_context_destroy(&ctx);
+
+ cleanup_context:
+       if (rdata != NULL)
+               dns_message_puttemprdata(msg, &rdata);
+       dst_context_destroy(&ctx);
        return (ret);
 }
 
index c0b9e2c69dbe83abc1a5a2d6466cb36edb1a96cb..6c0abe06932c076d88d3564bdf81e001d452f35c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: validator.c,v 1.119.18.16 2005/11/03 00:57:59 marka Exp $ */
+/* $Id: validator.c,v 1.119.18.17 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -2819,7 +2819,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
 
  cleanup_event:
        isc_task_detach(&tclone);
-       isc_event_free((isc_event_t **)&val->event);
+       isc_event_free((isc_event_t **)&event);
 
  cleanup_val:
        dns_view_weakdetach(&val->view);
index 6e5e8f1a91fdb2e66a7678c00e908dd768f5218e..37bb72be62255192a441a36dcb60f0070503cd53 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.410.18.35 2005/08/25 00:05:45 marka Exp $ */
+/* $Id: zone.c,v 1.410.18.36 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -832,12 +832,10 @@ dns_zone_setdbtype(dns_zone_t *zone,
 
  nomem:
        if (new != NULL) {
-               for (i = 0; i < dbargc; i++) {
-                       if (zone->db_argv[i] != NULL)
+               for (i = 0; i < dbargc; i++)
+                       if (new[i] != NULL)
                                isc_mem_free(zone->mctx, new[i]);
-                       isc_mem_put(zone->mctx, new,
-                                   dbargc * sizeof(*new));
-               }
+               isc_mem_put(zone->mctx, new, dbargc * sizeof(*new));
        }
        result = ISC_R_NOMEMORY;
 
@@ -1326,10 +1324,12 @@ zone_startload(dns_db_t *db, dns_zone_t *zone, isc_time_t loadtime) {
                                       zone_gotreadhandle, load,
                                       &zone->readio);
                if (result != ISC_R_SUCCESS) {
-                       tresult = dns_db_endload(load->db,
-                                                &load->callbacks.add_private);
-                       if (result == ISC_R_SUCCESS)
-                               result = tresult;
+                       /*
+                        * We can't report multiple errors so ignore
+                        * the result of dns_db_endload().
+                        */
+                       (void)dns_db_endload(load->db,
+                                            &load->callbacks.add_private);
                        goto cleanup;
                } else
                        result = DNS_R_CONTINUE;
@@ -2853,6 +2853,7 @@ dns_zone_refresh(dns_zone_t *zone) {
        isc_interval_t i;
        isc_uint32_t oldflags;
        unsigned int j;
+       isc_result_t result;
 
        REQUIRE(DNS_ZONE_VALID(zone));
 
@@ -2886,7 +2887,11 @@ dns_zone_refresh(dns_zone_t *zone) {
         */
        isc_interval_set(&i, isc_random_jitter(zone->retry, zone->retry / 4),
                         0);
-       isc_time_nowplusinterval(&zone->refreshtime, &i);
+       result = isc_time_nowplusinterval(&zone->refreshtime, &i);
+       if (result |= ISC_R_SUCCESS)
+               dns_zone_log(zone, ISC_LOG_WARNING,
+                            "isc_time_nowplusinterval() failed: %s",
+                            dns_result_totext(result));
 
        /*
         * When lacking user-specified timer values from the SOA,
index f1057837c2ce0ca525a390f9fe08cea729aaadd4..4cb8f3fc28d85728667bafcd594543214e0e8da1 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zt.c,v 1.38.18.4 2005/07/12 01:22:27 marka Exp $ */
+/* $Id: zt.c,v 1.38.18.5 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -380,9 +380,8 @@ dns_zt_apply2(dns_zt_t *zt, isc_boolean_t stop, isc_result_t *sub,
                                tresult = result;
                                goto cleanup;   /* don't break */
                        } else if (result != ISC_R_SUCCESS &&
-                                tresult != ISC_R_SUCCESS)
+                                  tresult == ISC_R_SUCCESS)
                                tresult = result;
-                               
                }
                result = dns_rbtnodechain_next(&chain, NULL, NULL);
        }
index a335daab9a28c42d1d6ba8f2823988635e82f37e..2e4e48ae33438155499902f65e9cf4f3fa74abf3 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lex.c,v 1.78.18.4 2005/06/04 00:39:04 marka Exp $ */
+/* $Id: lex.c,v 1.78.18.5 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -374,9 +374,6 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
        source = HEAD(lex->sources);
        REQUIRE(tokenp != NULL);
 
-       lex->saved_paren_count = lex->paren_count;
-       source->saved_line = source->line;
-
        if (source == NULL) {
                if ((options & ISC_LEXOPT_NOMORE) != 0) {
                        tokenp->type = isc_tokentype_nomore;
@@ -388,6 +385,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
        if (source->result != ISC_R_SUCCESS)
                return (source->result);
 
+       lex->saved_paren_count = lex->paren_count;
+       source->saved_line = source->line;
+
        if (isc_buffer_remaininglength(source->pushback) == 0 &&
            source->at_eof)
        {
@@ -627,10 +627,10 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
                                           (lex->data[0] != '0'))) {
                                        /* Above test supports hex numbers */
                                        state = lexstate_string;
-                               } else if ((options & ISC_LEXOPT_OCTAL) != 0 &&
-                                          (c == '8' || c == '9')) {
-                                       state = lexstate_string;
                                }
+                       } else if ((options & ISC_LEXOPT_OCTAL) != 0 &&
+                                  (c == '8' || c == '9')) {
+                               state = lexstate_string;
                        }
                        if (remaining == 0U) {
                                result = grow_data(lex, &remaining,
@@ -644,9 +644,13 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
                        remaining--;
                        break;
                case lexstate_string:
-                       if ((!escaped &&
-                            (c == ' ' || c == '\t' || lex->specials[c])) ||
-                           c == '\r' || c == '\n' || c == EOF) {
+                       /*
+                        * EOF needs to be checked before lex->specials[c]
+                        * as lex->specials[EOF] is not a good idea.
+                        */
+                       if (c == '\r' || c == '\n' || c == EOF ||
+                           (!escaped &&
+                            (c == ' ' || c == '\t' || lex->specials[c]))) {
                                pushback(source, c);
                                if (source->result != ISC_R_SUCCESS) {
                                        result = source->result;
index 57d289df676b479c6c56e266276ae24fd5d541e1..f1f619d26dce708bf0ea5d654f05477d681c6747 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: taskpool.c,v 1.12.18.2 2005/04/29 00:16:51 marka Exp $ */
+/* $Id: taskpool.c,v 1.12.18.3 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -54,6 +54,10 @@ isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx,
        pool->mctx = mctx;
        pool->ntasks = ntasks;
        pool->tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *));
+       if (pool->tasks == NULL) {
+               isc_mem_put(mctx, pool, sizeof(*pool));
+               return (ISC_R_NOMEMORY);
+       }
        for (i = 0; i < ntasks; i++)
                pool->tasks[i] = NULL;
        for (i = 0; i < ntasks; i++) {
index 69ebadc321d69d1fa4fbb52b448d1fd5f6982aa4..4b96fa5e4efeacfa2cb7d4d2667cc56786aa1032 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: timer.c,v 1.73.18.4 2005/10/26 06:50:49 marka Exp $ */
+/* $Id: timer.c,v 1.73.18.5 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -214,9 +214,10 @@ schedule(isc_timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) {
                isc_time_t then;
 
                isc_interval_set(&fifteen, 15, 0);
-               isc_time_add(&manager->due, &fifteen, &then);
+               result = isc_time_add(&manager->due, &fifteen, &then);
 
-               if (isc_time_compare(&then, now) < 0) {
+               if (result == ISC_R_SUCCESS &&
+                   isc_time_compare(&then, now) < 0) {
                        SIGNAL(&manager->wakeup);
                        signal_ok = ISC_FALSE;
                        isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
@@ -349,8 +350,10 @@ isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type,
 
        if (type == isc_timertype_once && !isc_interval_iszero(interval)) {
                result = isc_time_add(&now, interval, &timer->idle);
-               if (result != ISC_R_SUCCESS)
+               if (result != ISC_R_SUCCESS) {
+                       isc_mem_put(manager->mctx, timer, sizeof(*timer));
                        return (result);
+               }
        } else
                isc_time_settoepoch(&timer->idle);
 
index da8929090476fbcfe9030ee27ed1a3284474265c..4021d4a086c34e3d7413bc86664c6efe0fdaf18e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.237.18.19 2005/11/03 23:02:23 marka Exp $ */
+/* $Id: socket.c,v 1.237.18.20 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -2716,8 +2716,8 @@ socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
                dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
                dev->pktinfo = *pktinfo;
 
-               if (!isc_sockaddr_issitelocal(address) &&
-                   !isc_sockaddr_islinklocal(address)) {
+               if (!isc_sockaddr_issitelocal(&dev->address) &&
+                   !isc_sockaddr_islinklocal(&dev->address)) {
                        socket_log(sock, NULL, TRACE, isc_msgcat,
                                   ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED,
                                   "pktinfo structure provided, ifindex %u "
index 8677350f56fb01b53d7ca34c131ea16472813df3..676deb2e69a00e2b3918b60fb891967fb6146a91 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: parser.c,v 1.112.18.7 2005/09/05 00:18:31 marka Exp $ */
+/* $Id: parser.c,v 1.112.18.8 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -1569,12 +1569,19 @@ parse_token(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        isc_lex_getlasttokentext(pctx->lexer, &pctx->token, &r);
 
        obj->value.string.base = isc_mem_get(pctx->mctx, r.length + 1);
+       if (obj->value.string.base == NULL) {
+               result = ISC_R_NOMEMORY;
+               goto cleanup;
+       }
        obj->value.string.length = r.length;
        memcpy(obj->value.string.base, r.base, r.length);
        obj->value.string.base[r.length] = '\0';
        *ret = obj;
+       return (result);
 
  cleanup:
+       if (obj != NULL)
+               isc_mem_put(pctx->mctx, obj, sizeof(*obj));
        return (result);
 }
 
@@ -1809,8 +1816,6 @@ cfg_doc_netaddr(cfg_printer_t *pctx, const cfg_type_t *type) {
        if (*flagp != CFG_ADDR_V4OK && *flagp != CFG_ADDR_V6OK)
                cfg_print_chars(pctx, "( ", 2);
        if (*flagp & CFG_ADDR_V4OK) {
-               if (n != 0)
-                       cfg_print_chars(pctx, " | ", 3);
                cfg_print_cstr(pctx, "<ipv4_address>");
                n++;
        }
@@ -1997,8 +2002,6 @@ cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type) {
        int n = 0;
        cfg_print_chars(pctx, "( ", 2);
        if (*flagp & CFG_ADDR_V4OK) {
-               if (n != 0)
-                       cfg_print_chars(pctx, " | ", 3);
                cfg_print_cstr(pctx, "<ipv4_address>");
                n++;
        }
@@ -2291,7 +2294,6 @@ create_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        CHECK(isc_symtab_create(pctx->mctx, 5, /* XXX */
                                map_symtabitem_destroy,
                                pctx, ISC_FALSE, &symtab));
-
        obj->value.map.symtab = symtab;
        obj->value.map.id = NULL;
 
index a4716af7c87d0f45eb9d2172c98b2c6300269bc2..1a191a3a772f0ab5c1a74470ac46df2587a7a385 100644 (file)
@@ -18,7 +18,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: getaddrinfo.c,v 1.43.18.3 2005/06/08 02:07:58 marka Exp $ */
+/* $Id: getaddrinfo.c,v 1.43.18.4 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -438,8 +438,10 @@ lwres_getaddrinfo(const char *hostname, const char *servname,
                                                      NULL, 0,
                                                      NI_NUMERICHOST) == 0) {
                                        ai->ai_canonname = strdup(nbuf);
-                                       if (ai->ai_canonname == NULL)
+                                       if (ai->ai_canonname == NULL) {
+                                               lwres_freeaddrinfo(ai_list);
                                                return (EAI_MEMORY);
+                                       }
                                } else {
                                        /* XXX raise error? */
                                        ai->ai_canonname = NULL;
index 4383a8fca9767594279451ed608d5294a2b3ada8..9e896d443c1f551b4b5a29d6c5ab5ee45693f03f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_api.c,v 1.52.18.5 2005/06/17 02:27:16 marka Exp $ */
+/* $Id: t_api.c,v 1.52.18.6 2005/11/30 03:44:39 marka Exp $ */
 
 /*! \file */
 
@@ -542,7 +542,11 @@ t_fgetbs(FILE *fp) {
                        }
                }
                *p = '\0';
-               return(((c == EOF) && (n == 0U)) ? NULL : buf);
+               if (c == EOF && n == 0U) {
+                       free(buf);
+                       return (NULL);
+               }
+               return (buf);
        } else {
                fprintf(stderr, "malloc failed %d", errno);
                return(NULL);
@@ -749,8 +753,10 @@ t_eval(const char *filename, int (*func)(char **), int nargs) {
                        /*
                         * Skip comment lines.
                         */
-                       if ((isspace((unsigned char)*p)) || (*p == '#'))
+                       if ((isspace((unsigned char)*p)) || (*p == '#')) {
+                               (void)free(p);
                                continue;
+                       }
 
                        cnt = t_bustline(p, tokens);
                        if (cnt == nargs) {