]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] silence coverity warnings
authorEvan Hunt <each@isc.org>
Fri, 31 Jan 2014 17:34:37 +0000 (09:34 -0800)
committerEvan Hunt <each@isc.org>
Fri, 31 Jan 2014 17:34:37 +0000 (09:34 -0800)
- remove dead code in server.c
- initialize a struct tm.c

bin/named/server.c
bin/tests/names/t_names.c
lib/isc/tm.c

index 7a6b17a62cdc9e21dca9743b85d9e4d47d17eafc..b4f7918c291c98fc9b9d71c6d682cd386e6d0cfc 100644 (file)
@@ -1399,10 +1399,8 @@ check_dbtype(dns_zone_t *zone, unsigned int dbtypec, const char **dbargv,
         * Check that all the arguments match.
         */
        for (i = 0; i < dbtypec; i++)
-               if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0) {
+               if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0)
                        CHECK(ISC_R_FAILURE);
-                       break;
-               }
 
        /*
         * Check that there are not extra arguments.
index 1982e5ecac9858c25e217ecd5f4d2f596e9121ca..6b9c9762902167267448e709670d41999633c4f8 100644 (file)
@@ -823,7 +823,6 @@ t_dns_name_fullcompare(void) {
        if (fp != NULL) {
                line = 0;
                while ((p = t_fgetbs(fp)) != NULL) {
-
                        ++line;
 
                        /*
@@ -851,8 +850,8 @@ t_dns_name_fullcompare(void) {
                                else if (!strcmp(Tokens[2], "commonancestor"))
                                        reln = dns_namereln_commonancestor;
                                else {
-                                       t_info("bad format at line %d\n",
-                                              line);
+                                       t_info("bad format at line %d\n", line);
+                                       (void)free(p);
                                        continue;
                                }
                                result = test_dns_name_fullcompare(
index 08af2bcc95dde5e68bae900da82ff22d62ded7a6..842a2f7fb4ab878ef63a23d312b173736c583665 100644 (file)
@@ -147,6 +147,12 @@ isc_tm_strptime(const char *buf, const char *fmt, struct tm *tm) {
        size_t len = 0;
        int alt_format, i, split_year = 0;
 
+       REQUIRE(buf != NULL);
+       REQUIRE(fmt != NULL);
+       REQUIRE(tm != NULL);
+
+       memset(tm, 0, sizeof(struct tm));
+
        bp = buf;
 
        while ((c = *fmt) != '\0') {