summaryrefslogtreecommitdiff
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 13509fcbd..84a44f3b7 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;
}