]> err.no Git - varnish/commitdiff
Added some checks for NULL-pointers.
authorcecilihf <cecilihf@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Sep 2007 08:58:54 +0000 (08:58 +0000)
committercecilihf <cecilihf@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Sep 2007 08:58:54 +0000 (08:58 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1969 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend_random.c
varnish-cache/bin/varnishd/cache_backend_round_robin.c
varnish-cache/bin/varnishd/cache_response.c

index 50597911b04589d03c6e031aeaba29525b1da126..f1c1d0a67b6df42a9075c89c8b6b19843a52e401 100644 (file)
@@ -481,6 +481,7 @@ VRT_init_random_backend(struct backend **bp, struct vrt_random_backend *t)
        be = t->bentry;
        while (be != NULL) {
                bs = calloc(sizeof *bs, 1);
+               XXXAN(bs);
                bs->magic = BRSPEC_MAGIC;
                AN(be->port);
                bs->portname = strdup(be->port);
@@ -506,7 +507,7 @@ VRT_init_random_backend(struct backend **bp, struct vrt_random_backend *t)
                bs_prev = bs;
                be = be->next;
        }
-       
+       XXXAN(bs_first);
        bs_first->next = bs;
        ber->blist = bs;
        
index 5ef1404361afe580a444bcc28a0c58e2bfda84c4..73df4978db0cd46e412aaf239a6dd037e66e608b 100644 (file)
@@ -465,6 +465,7 @@ VRT_init_round_robin_backend(struct backend **bp, struct vrt_round_robin_backend
        be = t->bentry;
        while (be != NULL) {
                bs = calloc(sizeof *bs, 1);
+               XXXAN(bs);
                bs->magic = BSPEC_MAGIC;
                AN(be->port);
                bs->portname = strdup(be->port);
@@ -485,6 +486,7 @@ VRT_init_round_robin_backend(struct backend **bp, struct vrt_round_robin_backend
                be = be->next;
        }
        
+       XXXAN(bs_first);
        bs_first->next = bs;
        brr->blist = bs;
        
index 99663919ab7407bd9c9ef75d64274a186d63fbc1..3cfdaef5a8d9a6faa9025bb9b20fdbcded70453e 100644 (file)
@@ -132,6 +132,7 @@ RES_BuildHttp(struct sess *sp)
         */
        http_Unset(sp->http, H_Date);
        time_str = malloc(50);
+       XXXAN(time_str);
        sprintf(time_str, "Date: ");
        TIM_format(TIM_real(), &(time_str[6]));
        http_SetHeader(sp->wrk, sp->fd, sp->http, time_str);