r1969 - trunk/varnish-cache/bin/varnishd

cecilihf at projects.linpro.no cecilihf at projects.linpro.no
Thu Sep 20 10:58:54 CEST 2007


Author: cecilihf
Date: 2007-09-20 10:58:54 +0200 (Thu, 20 Sep 2007)
New Revision: 1969

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend_random.c
   trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c
   trunk/varnish-cache/bin/varnishd/cache_response.c
Log:
Added some checks for NULL-pointers.



Modified: trunk/varnish-cache/bin/varnishd/cache_backend_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_random.c	2007-09-20 08:46:25 UTC (rev 1968)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_random.c	2007-09-20 08:58:54 UTC (rev 1969)
@@ -481,6 +481,7 @@
 	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 @@
 		bs_prev = bs;
 		be = be->next;
 	}
-	
+	XXXAN(bs_first);
 	bs_first->next = bs;
 	ber->blist = bs;
 	

Modified: trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c	2007-09-20 08:46:25 UTC (rev 1968)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c	2007-09-20 08:58:54 UTC (rev 1969)
@@ -465,6 +465,7 @@
 	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 @@
 		be = be->next;
 	}
 	
+	XXXAN(bs_first);
 	bs_first->next = bs;
 	brr->blist = bs;
 	

Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c	2007-09-20 08:46:25 UTC (rev 1968)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c	2007-09-20 08:58:54 UTC (rev 1969)
@@ -132,6 +132,7 @@
 	 */
 	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);




More information about the varnish-commit mailing list