Commit 17c1ca12 authored by Cecilie Fritzvold's avatar Cecilie Fritzvold

Added some checks for NULL-pointers.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1969 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7dc6730c
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment