[master] 31a65a9 Storage allocation failues happen, let other code deal with it.

Poul-Henning Kamp phk at varnish-cache.org
Thu Jun 2 08:16:56 CEST 2011


commit 31a65a99d96e061dea7cd689d7b494fe6364e209
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jun 2 06:16:34 2011 +0000

    Storage allocation failues happen, let other code deal with it.
    
    Fixes #927

diff --git a/bin/varnishd/cache_esi_fetch.c b/bin/varnishd/cache_esi_fetch.c
index 196cf66..c8df1b1 100644
--- a/bin/varnishd/cache_esi_fetch.c
+++ b/bin/varnishd/cache_esi_fetch.c
@@ -371,7 +371,7 @@ vfp_esi_end(struct sess *sp)
 		assert(l > 0);
 		/* XXX: This is a huge waste of storage... */
 		sp->obj->esidata = STV_alloc(sp, l);
-		AN(sp->obj->esidata);
+		XXXAN(sp->obj->esidata);
 		memcpy(sp->obj->esidata->ptr, VSB_data(vsb), l);
 		sp->obj->esidata->len = l;
 		VSB_delete(vsb);
diff --git a/bin/varnishd/stevedore.c b/bin/varnishd/stevedore.c
index d33825e..413e0b6 100644
--- a/bin/varnishd/stevedore.c
+++ b/bin/varnishd/stevedore.c
@@ -191,7 +191,8 @@ stv_alloc(const struct sess *sp, size_t size)
 		if (++fail == 50)	/* XXX Param */
 			break;
 	}
-	CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
+	if (st != NULL)
+		CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
 	return (st);
 }
 



More information about the varnish-commit mailing list