From: phk Date: Thu, 20 Sep 2007 07:09:53 +0000 (+0000) Subject: Use FREE_OBJ() and REPLACE() macros X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e910c5851969c2b711439c340479322af1966e11;p=varnish Use FREE_OBJ() and REPLACE() macros git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1959 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_backend_simple.c b/varnish-cache/bin/varnishd/cache_backend_simple.c index 0994b425..1275ce9d 100644 --- a/varnish-cache/bin/varnishd/cache_backend_simple.c +++ b/varnish-cache/bin/varnishd/cache_backend_simple.c @@ -328,9 +328,9 @@ bes_Cleanup(struct backend *b) 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 @@ VRT_init_simple_backend(struct backend **bp, struct vrt_simple_backend *t) 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; }