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

Russell Bryant russell at digium.com
Sun Jul 6 08:38:03 CDT 2008

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.

Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.

More information about the asterisk-dev mailing list