From b495f23c01950e052d493dcbb8d3d74e0aa1ed2f Mon Sep 17 00:00:00 2001 From: cecilihf Date: Thu, 20 Sep 2007 08:58:54 +0000 Subject: [PATCH] Added some checks for NULL-pointers. 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 | 3 ++- varnish-cache/bin/varnishd/cache_backend_round_robin.c | 2 ++ varnish-cache/bin/varnishd/cache_response.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_backend_random.c b/varnish-cache/bin/varnishd/cache_backend_random.c index 50597911..f1c1d0a6 100644 --- a/varnish-cache/bin/varnishd/cache_backend_random.c +++ b/varnish-cache/bin/varnishd/cache_backend_random.c @@ -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; diff --git a/varnish-cache/bin/varnishd/cache_backend_round_robin.c b/varnish-cache/bin/varnishd/cache_backend_round_robin.c index 5ef14043..73df4978 100644 --- a/varnish-cache/bin/varnishd/cache_backend_round_robin.c +++ b/varnish-cache/bin/varnishd/cache_backend_round_robin.c @@ -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; diff --git a/varnish-cache/bin/varnishd/cache_response.c b/varnish-cache/bin/varnishd/cache_response.c index 99663919..3cfdaef5 100644 --- a/varnish-cache/bin/varnishd/cache_response.c +++ b/varnish-cache/bin/varnishd/cache_response.c @@ -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); -- 2.39.5