Merged revisions 49063 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Sat, 30 Dec 2006 03:40:42 +0000 (03:40 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 30 Dec 2006 03:40:42 +0000 (03:40 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49063 | file | 2006-12-29 22:37:22 -0500 (Fri, 29 Dec 2006) | 2 lines

Initialize the packet queue in load_module instead of just declaring the list with the default value. (issue #8695 reported by ssokol)

........

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

channels/chan_iax2.c

index dda1e68..5eb447e 100644 (file)
@@ -632,9 +632,7 @@ struct chan_iax2_pvt {
 static struct ast_iax2_queue {
        AST_LIST_HEAD(, iax_frame) queue;
        int count;
-} iaxq = {
-       .queue = AST_LIST_HEAD_INIT_VALUE
-};
+} iaxq;
 
 static AST_LIST_HEAD_STATIC(users, iax2_user);
 
@@ -9986,6 +9984,8 @@ static int __unload_module(void)
        AST_LIST_TRAVERSE_SAFE_END
        AST_LIST_UNLOCK(&dynamic_list);
 
+       AST_LIST_HEAD_DESTROY(&iaxq.queue);
+
        ast_netsock_release(netsock);
        for (x=0;x<IAX_MAX_CALLS;x++)
                if (iaxs[x])
@@ -10059,6 +10059,8 @@ static int load_module(void)
        }
 
        ast_netsock_init(netsock);
+
+       AST_LIST_HEAD_INIT(&iaxq.queue);
        
        ast_cli_register_multiple(cli_iax2, sizeof(cli_iax2) / sizeof(struct ast_cli_entry));