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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@269272
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
* 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 */