[experimental-ims] 380e7f2 Properly clean up if we bail out of cnt_error because we cannot allocate an object.

Geoff Simmons geoff at varnish-cache.org
Wed Aug 31 16:03:16 CEST 2011


commit 380e7f201bd2f2632df817157558801cf18ee41d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 22 08:21:02 2011 +0000

    Properly clean up if we bail out of cnt_error because we cannot allocate
    an object.
    
    Fixes	#985

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index 93bfc75..282acf0 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -424,6 +424,10 @@ cnt_error(struct sess *sp)
 			    1024, &w->exp, (uint16_t)params->http_max_hdr);
 		if (sp->obj == NULL) {
 			sp->doclose = "Out of objects";
+			sp->director = NULL;
+			sp->wrk->h_content_length = NULL;
+			http_Setup(sp->wrk->beresp, NULL);
+			http_Setup(sp->wrk->bereq, NULL);
 			sp->step = STP_DONE;
 			return(0);
 		}



More information about the varnish-commit mailing list