]> 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)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Thu, 20 Jun 2024 18:39:44 +0000 (18:39 +0000)
commit7d28165cb1b2d02d66e8693bd3fe23ee72fc55d8
treeecd97c6f6768be6844ba7bd9d30a5d63f0250dd0
parent07aa0ffe6adebd827ce0234f3bcd84a30905c4a8
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