diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-13 19:33:19 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-13 19:33:19 +0000 |
commit | cf0824d649034a7b95357acc320f2b5e231dccfa (patch) | |
tree | 405cb4185066e81e11c3d3441d0ee415da04ee30 /res/res_musiconhold.c | |
parent | 3de8e3934b11017fd83dcfb2f767022aa87ab8c8 (diff) |
Merged revisions 188102 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r188102 | mmichelson | 2009-04-13 14:31:48 -0500 (Mon, 13 Apr 2009) | 5 lines
Fix another crash related to cached realtime music on hold.
This was another off-by-one problem caused by moh_register.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@188105 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r-- | res/res_musiconhold.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 01920e087..c1ab05dac 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1072,7 +1072,9 @@ static int moh_register(struct mohclass *moh, int reload, int unref) if (!mohclass->delete) { ast_log(LOG_WARNING, "Music on Hold class '%s' already exists\n", moh->name); mohclass = mohclass_unref(mohclass, "unreffing mohclass we just found by name"); - moh = mohclass_unref(moh, "unreffing potential new moh class (it is a duplicate)"); + if (unref) { + moh = mohclass_unref(moh, "unreffing potential new moh class (it is a duplicate)"); + } return -1; } mohclass = mohclass_unref(mohclass, "Unreffing mohclass we just found by name"); |