]> err.no Git - varnish/commitdiff
Use FREE_OBJ() and REPLACE() macros
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Sep 2007 07:09:53 +0000 (07:09 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Sep 2007 07:09:53 +0000 (07:09 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1959 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend_simple.c

index 0994b425ed980aaa21c55cbe21db61434c689223..1275ce9d32af5e82ff7d5f8be5d7b6dc0b66c56d 100644 (file)
@@ -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;
 }