[asterisk-dev] oej: trunk r128242 - /trunk/channels/chan_sip.c

Johansson Olle E oej at edvina.net
Sun Jul 6 09:13:19 CDT 2008


6 jul 2008 kl. 15.38 skrev Russell Bryant:

>
> On Jul 6, 2008, at 9:22 AM, Tilghman Lesher wrote:
>
>> find_peer returns a reference to the peer found, if any.  If you
>> don't want
>> the reference, you'll need to capture the return value and deref it:
>>
>> if (sipmethod != SIP_SUBSCRIBE) {
>> 	struct sip_peer *tmp = find_peer(NULL, &p->recv, TRUE, FALSE);
>> 	if (tmp) {
>> 		unref_peer(tmp);
>> 	}
>> }
>
>
> Is there a reason that find_peer is being called at all when the
> result is ignored?  That seems a bit odd.

As you see, there was a huge bug there. I fixed it. Thanks for pointing
at that part of the code. You must have a large capacity for code  
review,
and I need your assistance there!

/O



More information about the asterisk-dev mailing list