diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c index 5735eed7ec4..71f941e3484 100644 --- a/bin/varnishd/storage/storage_simple.c +++ b/bin/varnishd/storage/storage_simple.c @@ -252,21 +252,25 @@ sml_slim(struct worker *wrk, struct objcore *oc) static void v_matchproto_(objfree_f) sml_objfree(struct worker *wrk, struct objcore *oc) { + const struct stevedore *stv; struct storage *st; struct object *o; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); - sml_slim(wrk, oc); + stv = oc->stobj->stevedore; + CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC); CAST_OBJ_NOTNULL(o, oc->stobj->priv, OBJECT_MAGIC); + + sml_slim(wrk, oc); st = o->objstore; CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC); FINI_OBJ(o); - if (oc->boc == NULL && oc->stobj->stevedore->lru != NULL) + if (oc->boc == NULL && stv->lru != NULL) LRU_Remove(oc); - sml_stv_free(oc->stobj->stevedore, st); + sml_stv_free(stv, st); memset(oc->stobj, 0, sizeof oc->stobj);