Commit 26d52615 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland Committed by Pål Hermunn Johansen

Fix memory leak of vary string on stevedore alloc fail

If the stevedore failed the object creation, we would leak the temporary
VSB holding the computed vary string. This patch frees it.

Problem exists in 4.1 and later.
parent 3d85f730
......@@ -125,8 +125,12 @@ vbf_beresp2obj(struct busyobj *bo)
if (bo->uncacheable)
bo->fetch_objcore->flags |= OC_F_PASS;
if (!vbf_allocobj(bo, l))
if (!vbf_allocobj(bo, l)) {
if (vary != NULL)
VSB_destroy(&vary);
AZ(vary);
return (-1);
}
if (vary != NULL) {
b = ObjSetattr(bo->wrk, bo->fetch_objcore, OA_VARY, varyl,
......
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