[master] 84b76e8 try to make coverty happy

Nils Goroll nils.goroll at uplex.de
Wed Mar 1 22:27:05 CET 2017


commit 84b76e8bb90f24ab40de293cbf03e25208fd3088
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Feb 28 20:55:03 2017 +0100

    try to make coverty happy

diff --git a/lib/libvmod_directors/shard_cfg.c b/lib/libvmod_directors/shard_cfg.c
index 7db0f88..f36d2d5 100644
--- a/lib/libvmod_directors/shard_cfg.c
+++ b/lib/libvmod_directors/shard_cfg.c
@@ -321,6 +321,9 @@ shardcfg_backend_cmp(const struct shard_backend *a,
 	ai = a->ident;
 	bi = b->ident;
 
+	assert(ai || a->backend);
+	assert(bi || b->backend);
+
 	/* vcl_names are unique, so we can compare the backend pointers */
 	if (ai == NULL && bi == NULL)
 		return a->backend != b->backend;
@@ -339,7 +342,9 @@ static int
 shardcfg_backend_del_cmp(const struct shard_backend *task,
     const struct shard_backend *b)
 {
-	if (task->backend && task->ident == NULL)
+	assert(task->backend || task->ident);
+
+	if (task->ident == NULL)
 		return task->backend != b->backend;
 
 	return shardcfg_backend_cmp(task, b);



More information about the varnish-commit mailing list