[master] 3261a9f We always have a bo->fetch_objcore, don't confuse Coverity with a NULL test in the middle of things.

Poul-Henning Kamp phk at FreeBSD.org
Mon Sep 22 10:01:28 CEST 2014


commit 3261a9fe46ed0c3014f11c76a028d3128583899f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Sep 22 08:00:40 2014 +0000

    We always have a bo->fetch_objcore, don't confuse Coverity with a
    NULL test in the middle of things.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 3dbd83a..8de0923 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -509,6 +509,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
+	CHECK_OBJ_NOTNULL(bo->fetch_objcore, OBJCORE_MAGIC);
 
 	assert(wrk->handling == VCL_RET_DELIVER);
 
@@ -624,8 +625,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 
 	if (bo->vfc->failed && !bo->do_stream) {
 		assert(bo->state < BOS_STREAM);
-		if (bo->fetch_objcore != NULL)
-			ObjFreeObj(bo->wrk, bo->fetch_objcore);
+		ObjFreeObj(bo->wrk, bo->fetch_objcore);
 		return (F_STP_ERROR);
 	}
 



More information about the varnish-commit mailing list