[asterisk-commits] alecdavis: trunk r287671 - in /trunk: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 20 17:24:58 CDT 2010


Author: alecdavis
Date: Mon Sep 20 17:24:51 2010
New Revision: 287671

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287671
Log:
Merged revisions 287661 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r287661 | alecdavis | 2010-09-21 10:21:50 +1200 (Tue, 21 Sep 2010) | 14 lines
  
  ast_do_masquerade. Keep channels ao2_container locked while unlink and linking channels.
  
  Previously, Masquerade would unlock 'original' and 'clonechan' and allow another masq thread to run.
  End result would be corrupted memory, and the frequent report 'Bad Magic Number'.
  
  (closes issue #17801,#17710)
  Reported by: notthematrix
  Patches: 
        Based on bug17801.diff1.txt uploaded by alecdavis (license 585)
  Tested by: alecdavis
  
  Review: https://reviewboard.asterisk.org/r/928
........

Modified:
    trunk/   (props changed)
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=287671&r1=287670&r2=287671
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Mon Sep 20 17:24:51 2010
@@ -5984,9 +5984,6 @@
 	ao2_unlink(channels, original);
 	ao2_unlink(channels, clonechan);
 
-	/* now that both channels are locked and unlinked from the container, it is safe to unlock it */
-	ao2_unlock(channels);
-
 	ast_debug(4, "Actually Masquerading %s(%d) into the structure of %s(%d)\n",
 		clonechan->name, clonechan->_state, original->name, original->_state);
 
@@ -6268,6 +6265,8 @@
 		ast_channel_unlock(original);
 		ao2_link(channels, original);
 	}
+
+	ao2_unlock(channels);
 
 	return 0;
 }




More information about the asterisk-commits mailing list