Commit e3886003 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Make a dedicated cleanup function for req->vary_? to match the

dedicated setup function we have.

Fixes	#1553
parent 752a95f1
......@@ -1187,6 +1187,7 @@ int VRY_Create(struct busyobj *bo, struct vsb **psb);
int VRY_Match(struct req *, const uint8_t *vary);
unsigned VRY_Validate(const uint8_t *vary);
void VRY_Prep(struct req *);
void VRY_Clear(struct req *);
enum vry_finish_flag { KEEP, DISCARD };
void VRY_Finish(struct req *req, enum vry_finish_flag);
......
......@@ -472,8 +472,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
if (boc != NULL) {
(void)HSH_DerefObjCore(&wrk->stats, &boc);
free(req->vary_b);
req->vary_b = NULL;
VRY_Clear(req);
}
return (REQ_FSM_MORE);
......@@ -527,7 +526,7 @@ cnt_miss(struct worker *wrk, struct req *req)
default:
WRONG("Illegal return from vcl_miss{}");
}
free(req->vary_b);
VRY_Clear(req);
if (o != NULL)
(void)HSH_DerefObj(&wrk->stats, &o);
AZ(HSH_DerefObjCore(&wrk->stats, &req->objcore));
......
......@@ -238,6 +238,18 @@ VRY_Prep(struct req *req)
req->vary_b[2] = '\0';
}
void
VRY_Clear(struct req *req)
{
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
if (req->vary_b != NULL)
free(req->vary_b);
req->vary_b = NULL;
AZ(req->vary_e);
AZ(req->vary_l);
}
/**********************************************************************
* Finish predictive vary processing
*/
......
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