Commit 9f8a3cf4 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vcl: Centralize struct vcldir tear down

And doing so plug the director lock leak spotted by asan.

Refs 47586588
Refs 6e9b8d6d
parent d042154e
......@@ -457,11 +457,9 @@ vcl_KillBackends(struct vcl *vcl)
if (vdir == NULL)
break;
VTAILQ_REMOVE(&vcl->director_list, vdir, list);
REPLACE(vdir->cli_name, NULL);
AN(vdir->methods->destroy);
vdir->methods->destroy(vdir->dir);
FREE_OBJ(vdir->dir);
FREE_OBJ(vdir);
vcldir_free(vdir);
}
Lck_Unlock(&vcl_mtx);
}
......
......@@ -71,6 +71,7 @@ extern struct lock vcl_mtx;
extern struct vcl *vcl_active; /* protected by vcl_mtx */
struct vcl *vcl_find(const char *);
void VCL_Update(struct vcl **, struct vcl *);
void vcldir_free(struct vcldir *);
struct vcltemp {
const char * const name;
......
......@@ -138,7 +138,7 @@ VCL_Rel(struct vcl **vcc)
/*--------------------------------------------------------------------*/
static void
void
vcldir_free(struct vcldir *vdir)
{
......
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