[Asterisk-code-review] rtp engine/res rtp asterisk: Fix RTP struct reentrancy crashes. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Apr 12 11:15:55 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/5341 )

Change subject: rtp_engine/res_rtp_asterisk: Fix RTP struct reentrancy crashes.
......................................................................


Patch Set 6:

(2 comments)

https://gerrit.asterisk.org/#/c/5341/6/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:

Line 686: 	}
> Why did you remove the ast_rtp_ice_stop() call here?
Because it is done by ice_create() as needed.


Line 810: 			ao2_unlock(instance);
> Why aren't we grabbing an additional reference to the instance around these
There is no need to do that because there is no risk that instance will go away.  In this case, the function's caller has just created the instance and intends to return it.

Generally we don't need to grab a ref when if we already have a claim to a ref before we unlock because that is a feature of ao2 objects.  It is an exceptional situation where we would have to grab a ref to ensure an ao2 object won't go away on us.  For example, if we have obtained a pointer to an ao2 object but we don't actually have a ref to it.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I780b39ec935dcefcce880d50c1a7261744f1d1b4
Gerrit-PatchSet: 6
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sebastian Gutierrez <scgm11 at gmail.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list