From 48def18179c33c2d73ce589e5db2fba0a8e587a9 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 31 Jan 2014 09:34:37 -0800 Subject: [PATCH] [master] silence coverity warnings - remove dead code in server.c - initialize a struct tm.c --- bin/named/server.c | 4 +--- bin/tests/names/t_names.c | 5 ++--- lib/isc/tm.c | 6 ++++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index 7a6b17a62c..b4f7918c29 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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. diff --git a/bin/tests/names/t_names.c b/bin/tests/names/t_names.c index 1982e5ecac..6b9c976290 100644 --- a/bin/tests/names/t_names.c +++ b/bin/tests/names/t_names.c @@ -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( diff --git a/lib/isc/tm.c b/lib/isc/tm.c index 08af2bcc95..842a2f7fb4 100644 --- a/lib/isc/tm.c +++ b/lib/isc/tm.c @@ -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') {