Blame SOURCES/unbound-1.6.3-coverity.patch

5f4e7f
diff --git a/compat/arc4_lock.c b/compat/arc4_lock.c
5f4e7f
index 0c45ad0..7fb9cdc 100644
5f4e7f
--- a/compat/arc4_lock.c
5f4e7f
+++ b/compat/arc4_lock.c
5f4e7f
@@ -32,7 +32,7 @@
5f4e7f
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f4e7f
  */
5f4e7f
 #include "config.h"
5f4e7f
-#define LOCKRET(func) func
5f4e7f
+#define LOCKRET(func) (void)func
5f4e7f
 #include "util/locks.h"
5f4e7f
 
5f4e7f
 void _ARC4_LOCK(void);
5f4e7f
diff --git a/daemon/remote.c b/daemon/remote.c
5f4e7f
index 243d94c..a377aca 100644
5f4e7f
--- a/daemon/remote.c
5f4e7f
+++ b/daemon/remote.c
5f4e7f
@@ -371,7 +371,9 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
5f4e7f
 					  (unsigned)cfg_uid, (unsigned)cfg_gid,
5f4e7f
 					  ip, strerror(errno));
5f4e7f
 			}
5f4e7f
-			chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
5f4e7f
+			if (chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)) == -1)
5f4e7f
+				verbose(VERB_QUERY, "cannot chmod %s: %s",
5f4e7f
+					ip, strerror(errno));
5f4e7f
 #else
5f4e7f
 			(void)cfg;
5f4e7f
 #endif
5f4e7f
@@ -387,7 +389,7 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
5f4e7f
 			}
5f4e7f
 #endif /* USE_WINSOCK */
5f4e7f
 			log_err("control interface %s:%s getaddrinfo: %s %s",
5f4e7f
-				ip?ip:"default", port, gai_strerror(r),
5f4e7f
+				ip, port, gai_strerror(r),
5f4e7f
 #ifdef EAI_SYSTEM
5f4e7f
 				r==EAI_SYSTEM?(char*)strerror(errno):""
5f4e7f
 #else
5f4e7f
diff --git a/iterator/iter_scrub.c b/iterator/iter_scrub.c
5f4e7f
index 1bee85c..6bdfe41 100644
5f4e7f
--- a/iterator/iter_scrub.c
5f4e7f
+++ b/iterator/iter_scrub.c
5f4e7f
@@ -437,7 +437,6 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg,
5f4e7f
 					rrset->rrset_all_next =
5f4e7f
 						nx->rrset_all_next;
5f4e7f
 					nx->rrset_all_next = rrset;
5f4e7f
-					prev = nx;
5f4e7f
 				}
5f4e7f
 			}
5f4e7f
 
5f4e7f
diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c
5f4e7f
index 3b53676..36c67c6 100644
5f4e7f
--- a/services/listen_dnsport.c
5f4e7f
+++ b/services/listen_dnsport.c
5f4e7f
@@ -1072,11 +1072,11 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp,
5f4e7f
 {
5f4e7f
 	int s, noip6=0;
5f4e7f
 #ifdef USE_DNSCRYPT
5f4e7f
-	int is_dnscrypt = ((strchr(ifname, '@') && 
5f4e7f
+	const int is_dnscrypt = ((strchr(ifname, '@') &&
5f4e7f
 			atoi(strchr(ifname, '@')+1) == dnscrypt_port) ||
5f4e7f
 			(!strchr(ifname, '@') && atoi(port) == dnscrypt_port));
5f4e7f
 #else
5f4e7f
-	int is_dnscrypt = 0;
5f4e7f
+	const int is_dnscrypt = 0;
5f4e7f
 	(void)dnscrypt_port;
5f4e7f
 #endif
5f4e7f
 
5f4e7f
diff --git a/services/localzone.c b/services/localzone.c
5f4e7f
index 6bde432..00d044a 100644
5f4e7f
--- a/services/localzone.c
5f4e7f
+++ b/services/localzone.c
5f4e7f
@@ -1079,7 +1079,7 @@ local_zones_tags_lookup(struct local_zones* zones,
5f4e7f
 	key.name = name;
5f4e7f
 	key.namelen = len;
5f4e7f
 	key.namelabs = labs;
5f4e7f
-	rbtree_find_less_equal(&zones->ztree, &key, &res;;
5f4e7f
+	(void)rbtree_find_less_equal(&zones->ztree, &key, &res;;
5f4e7f
 	result = (struct local_zone*)res;
5f4e7f
 	/* exact or smaller element (or no element) */
5f4e7f
 	if(!result || result->dclass != dclass)
5f4e7f
diff --git a/smallapp/unbound-host.c b/smallapp/unbound-host.c
5f4e7f
index d7a36a2..68f789a 100644
5f4e7f
--- a/smallapp/unbound-host.c
5f4e7f
+++ b/smallapp/unbound-host.c
5f4e7f
@@ -330,6 +330,7 @@ pretty_output(char* q, int t, int c, struct ub_result* result, int docname)
5f4e7f
 					exit(1);
5f4e7f
 				}
5f4e7f
 				printf("%s\n", s);
5f4e7f
+				free(s);
5f4e7f
 			} else	printf(" has no %s record", tstr);
5f4e7f
 			printf(" %s\n", secstatus);
5f4e7f
 		}