Commit 164378c5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix and test a refcount leak

parent 129be2f9
......@@ -370,6 +370,7 @@ cnt_fetch(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
AZ(req->obj);
req->acct_req.fetch++;
......@@ -378,7 +379,7 @@ cnt_fetch(struct worker *wrk, struct req *req)
if (req->objcore->flags & OC_F_FAILED) {
req->err_code = 503;
req->req_step = R_STP_ERROR;
//XXX ? AZ(HSH_DerefObjCore(&wrk->stats, &req->objcore));
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
req->objcore = NULL;
return (REQ_FSM_MORE);
}
......
......@@ -22,6 +22,9 @@ client c1 {
expect resp.status == 503
} -run
varnish v1 -expect n_object == 0
varnish v1 -expect n_objectcore == 0
server s1 {
rxreq
send "HTTP/1.1 200 Ok\r\nConnection: close\r\n\r\n"
......@@ -36,3 +39,7 @@ client c1 {
rxresp
expect resp.status == 200
} -run
varnish v1 -expect n_object == 1
varnish v1 -expect n_objectcore == 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment