[svn-commits] russell: branch 1.4 r107099 - /branches/1.4/main/channel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 10 11:58:58 CDT 2008


Author: russell
Date: Mon Mar 10 11:58:57 2008
New Revision: 107099

URL: http://svn.digium.com/view/asterisk?view=rev&rev=107099
Log:
Fix a race condition where the generator can go away
(closes issue #12175, reported by edantie, patched by me)

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=107099&r1=107098&r2=107099
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Mar 10 11:58:57 2008
@@ -1560,8 +1560,12 @@
 	ast_channel_lock(chan);
 	tmp = chan->generatordata;
 	chan->generatordata = NULL;
-	generate = chan->generator->generate;
+	if (chan->generator)
+		generate = chan->generator->generate;
 	ast_channel_unlock(chan);
+
+	if (!tmp || !generate)
+		return 0;
 
 	res = generate(chan, tmp, 0, 160);
 




More information about the svn-commits mailing list