[Asterisk-code-review] chan sip: Prevent deadlock when issuing "sip show channels" (asterisk[11])

Corey Farrell asteriskteam at digium.com
Thu Jul 21 14:07:03 CDT 2016


Corey Farrell has posted comments on this change.

Change subject: chan_sip: Prevent deadlock when issuing "sip show channels"
......................................................................


Patch Set 3:

(2 comments)

https://gerrit.asterisk.org/#/c/3273/3/channels/chan_sip.c
File channels/chan_sip.c:

Line 20738: 	for (; (cur = ao2_iterator_next(&i)); ao2_ref(cur, -1)) {
Nit: would you mind switching this to a while loop?

while ((cur = ao2_iterator_next(&i))) {
  ...
  ao2_ref(cur, -1);
}

I find it confusing / difficult to read when we have cleanup in the 3rd part of for.


Line 21136: 	for (; (cur = ao2_iterator_next(&i)); ao2_ref(cur, -1)) {
Same.


-- 
To view, visit https://gerrit.asterisk.org/3273
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9980419909e811f89484950ed46ef117b9eb990
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list