[asterisk-commits] dvossel: trunk r269271 - /trunk/res/res_musiconhold.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 9 10:09:28 CDT 2010


Author: dvossel
Date: Wed Jun  9 10:09:25 2010
New Revision: 269271

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=269271
Log:
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.


Modified:
    trunk/res/res_musiconhold.c

Modified: trunk/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=269271&r1=269270&r2=269271
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Wed Jun  9 10:09:25 2010
@@ -1373,7 +1373,10 @@
 				 * 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 */
 




More information about the asterisk-commits mailing list