r1959 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Sep 20 09:09:53 CEST 2007


Author: phk
Date: 2007-09-20 09:09:53 +0200 (Thu, 20 Sep 2007)
New Revision: 1959

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
Log:
Use FREE_OBJ() and REPLACE() macros


Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_simple.c	2007-09-20 07:03:09 UTC (rev 1958)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_simple.c	2007-09-20 07:09:53 UTC (rev 1959)
@@ -328,9 +328,9 @@
 		TAILQ_REMOVE(&bes->connlist, vbe, list);
 		if (vbe->fd >= 0)
 			close(vbe->fd);
-		free(vbe);
+		FREE_OBJ(vbe);
 	}
-	free(bes);
+	FREE_OBJ(bes);
 }
 
 /*--------------------------------------------------------------------*/
@@ -419,16 +419,13 @@
 	bes->dnsttl = 300;
 
 	AN(t->name);
-	b->vcl_name = strdup(t->name);
-	XXXAN(b->vcl_name);
+	REPLACE(b->vcl_name, t->name);
 
 	AN(t->port);
-	bes->portname = strdup(t->port);
-	XXXAN(bes->portname);
+	REPLACE(bes->portname, t->port);
 
 	AN(t->host);
-	bes->hostname = strdup(t->host);
-	XXXAN(bes->hostname);
+	REPLACE(bes->hostname, t->host);
 
 	*bp = b;
 }




More information about the varnish-commit mailing list