aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-09 15:13:55 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-09 15:13:55 +0000
commitf5ee583bae938058b0bcbf3c8653f806e7b8e456 (patch)
treeb11ebf526ed86ed740a9cd41685593568c115304 /res
parent35de431cfda12cfdc6d94f9c5f11b6683aa3a979 (diff)
Merged revisions 269271 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r269271 | dvossel | 2010-06-09 10:09:25 -0500 (Wed, 09 Jun 2010) | 15 lines fixes crash in moh when cachertclasses flag is used The result for moh_register was not verified to guarantee the mohclass as added to the container. (closes issue #16993) Reported by: dmitri Patches: res_musiconhold_rtclass2.patch uploaded by dmitri (license 1001) moh_crash2.diff uploaded by dvossel (license 671) Tested by: dmitri ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@269272 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_musiconhold.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 8af2b76b8..e530744cd 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -1347,7 +1347,10 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
* has a pointer to a freed mohclass, so any operations involving the mohclass container would result in reading
* invalid memory.
*/
- moh_register(mohclass, 0, DONT_UNREF);
+ if (moh_register(mohclass, 0, DONT_UNREF) == -1) {
+ mohclass = mohclass_unref(mohclass, "unreffing mohclass failed to register");
+ return -1;
+ }
} else {
/* We don't register RT moh class, so let's init it manualy */