[asterisk-commits] mmichelson: branch 1.6.0 r201459 - in /branches/1.6.0: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 17 15:05:12 CDT 2009


Author: mmichelson
Date: Wed Jun 17 15:05:09 2009
New Revision: 201459

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201459
Log:
Merged revisions 201458 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r201458 | mmichelson | 2009-06-17 15:04:12 -0500 (Wed, 17 Jun 2009) | 15 lines
  
  Merged revisions 201450 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r201450 | mmichelson | 2009-06-17 14:59:31 -0500 (Wed, 17 Jun 2009) | 9 lines
    
    Change the datastore traversal in ast_do_masquerade to use a safe list traversal.
    
    It is possible for datastore fixup functions to remove the datastore from the list
    and free it. In particular, the queue_transfer_fixup in app_queue does this. While
    I don't yet know of this causing any crashes, it certainly could.
    
    Found while discussing a separate issue with Brian Degenhardt.
  ........
................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/channel.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/main/channel.c?view=diff&rev=201459&r1=201458&r2=201459
==============================================================================
--- branches/1.6.0/main/channel.c (original)
+++ branches/1.6.0/main/channel.c Wed Jun 17 15:05:09 2009
@@ -4403,10 +4403,14 @@
 	/* Move data stores over */
 	if (AST_LIST_FIRST(&clone->datastores)) {
 		struct ast_datastore *ds;
-		AST_LIST_TRAVERSE(&clone->datastores, ds, entry) {
+		/* We use a safe traversal here because some fixup routines actually
+		 * remove the datastore from the list and free them.
+		 */
+		AST_LIST_TRAVERSE_SAFE_BEGIN(&clone->datastores, ds, entry) {
 			if (ds->info->chan_fixup)
 				ds->info->chan_fixup(ds->data, clone, original);
 		}
+		AST_LIST_TRAVERSE_SAFE_END;
 		AST_LIST_APPEND_LIST(&original->datastores, &clone->datastores, entry);
 	}
 




More information about the asterisk-commits mailing list