]> git.ipfire.org Git - thirdparty/asterisk.git/commit
bridge_basic.c: Make sure that ast_bridge_channel is not destroyed while iterating...
authorTinet-mucw <mucw@ti-net.com.cn>
Fri, 14 Jun 2024 02:16:36 +0000 (19:16 -0700)
committerTinet-mucw <mucw@ti-net.com.cn>
Thu, 20 Jun 2024 18:39:39 +0000 (18:39 +0000)
commit642df06a3289fa978d11e24f18e05eb241cd6dc9
tree195c97f2482757f7b3c4c4b4e3ea6d10b492da96
parent41d4db99cf54c4379cca01013d8f773670902fb7
bridge_basic.c: Make sure that ast_bridge_channel is not destroyed while iterating over bridge->channels.
From the gdb information, we can see that while iterating over bridge->channels, the ast_bridge_channel reference count is 0, indicating it has already been destroyed.Additionally, when ast_bridge_channel is removed from bridge->channels, the bridge is first locked. Therefore, locking the bridge before iterating over bridge->channels can resolve the race condition.

Resolves: https://github.com/asterisk/asterisk/issues/768
main/bridge_basic.c