From: Mark Michelson Date: Mon, 13 Apr 2009 19:33:04 +0000 (+0000) Subject: Merged revisions 188102 via svnmerge from X-Git-Tag: 1.6.1.0-rc5~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa01f5b0b1e555f434eb4de46bd93f93ed630bec;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@188104 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 9f84a9378c..4d70b575fb 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1062,7 +1062,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");