]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix up datastore handling in ast_do_masquerade(). The code is intended to move
authorRussell Bryant <russell@russellbryant.com>
Mon, 5 Nov 2007 17:46:02 +0000 (17:46 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 5 Nov 2007 17:46:02 +0000 (17:46 +0000)
any channel datastores from the old channel to the new one.  However, it did
not use the linked list macros properly to accomplish the task.  The existing
code would only work if there was only a single datastore on the old channel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index d1ea7b43858e39df5f24dce6f6e475bf5893e380..a278462d1e198e67f4b27fadc32d50f50f204a62 100644 (file)
@@ -3786,8 +3786,7 @@ int ast_do_masquerade(struct ast_channel *original)
 
        /* Move data stores over */
        if (AST_LIST_FIRST(&clone->datastores))
-                AST_LIST_INSERT_TAIL(&original->datastores, AST_LIST_FIRST(&clone->datastores), entry);
-       AST_LIST_HEAD_INIT_NOLOCK(&clone->datastores);
+               AST_LIST_APPEND_LIST(&original->datastores, &clone->datastores, entry);
 
        clone_variables(original, clone);
        /* Presense of ADSI capable CPE follows clone */