[master] e66c5eb avoid TRUST_ME in shard director

Nils Goroll nils.goroll at uplex.de
Tue May 8 15:55:08 UTC 2018


commit e66c5eb5a221144628f3a6a44d5d72f629f68ed2
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue May 8 17:13:37 2018 +0200

    avoid TRUST_ME in shard director

diff --git a/lib/libvmod_directors/shard_cfg.c b/lib/libvmod_directors/shard_cfg.c
index 942932e..d8ac651 100644
--- a/lib/libvmod_directors/shard_cfg.c
+++ b/lib/libvmod_directors/shard_cfg.c
@@ -293,8 +293,8 @@ shardcfg_hashcircle(struct sharddir *shardd, VCL_INT replicas)
 static void
 shardcfg_backend_free(struct shard_backend *f)
 {
-	if (f->ident)
-		free (TRUST_ME(f->ident));
+	if (f->freeptr)
+		free (f->freeptr);
 	memset(f, 0, sizeof(*f));
 }
 
diff --git a/lib/libvmod_directors/shard_dir.h b/lib/libvmod_directors/shard_dir.h
index 350437f..7bf5d75 100644
--- a/lib/libvmod_directors/shard_dir.h
+++ b/lib/libvmod_directors/shard_dir.h
@@ -57,7 +57,10 @@ struct shard_circlepoint {
 
 struct shard_backend {
 	VCL_BACKEND		backend;
-	const char		*ident;	// XXX COPY IN !
+	union {
+		const char	*ident;
+		void		*freeptr;
+	};
 	VCL_DURATION		rampup;
 	uint32_t		canon_point;
 };


More information about the varnish-commit mailing list