diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 13509fcbd9..84a44f3b75 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -695,7 +695,10 @@ static struct mohdata *mohalloc(struct mohclass *cl) moh->f.offset = AST_FRIENDLY_OFFSET; moh->parent = cl; + + AST_RWLIST_WRLOCK(&mohclasses); AST_LIST_INSERT_HEAD(&cl->members, moh, list); + AST_RWLIST_UNLOCK(&mohclasses); return moh; }