Commit c1aa3c20 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Proper locking around n_backend. Found by Coverity.

parent e0d796b6
......@@ -94,9 +94,11 @@ vdir_release(struct vdir *vd)
CHECK_OBJ_NOTNULL(vd, VDIR_MAGIC);
vdir_wrlock(vd);
for (u = 0; u < vd->n_backend; u++)
VRT_Assign_Backend(&vd->backend[u], NULL);
vd->n_backend = 0;
vdir_unlock(vd);
}
void
......
......@@ -90,9 +90,9 @@ vmod_rr_resolve(VRT_CTX, VCL_BACKEND dir)
break;
}
rr->nxt = nxt;
vdir_unlock(rr->vd);
if (u == rr->vd->n_backend)
be = NULL;
vdir_unlock(rr->vd);
return (be);
}
......
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