[asterisk-dev] [svn-commits] tilghman: trunk r114683 - /trunk/channels/chan_sip.c

Russell Bryant russell at digium.com
Sat Apr 26 09:07:31 CDT 2008


SVN commits to the Digium repositories wrote:
> Author: tilghman
> Date: Fri Apr 25 21:48:56 2008
> New Revision: 114683
> 
> URL: http://svn.digium.com/view/asterisk?view=rev&rev=114683
> Log:
> Add 'sip qualify peer <peer>' command (with AMI SIPqualifypeer)
> (closes issue #12524)
>  Reported by: ctooley
>  Patches: 
>        sip_qualify_peer.diff.2 uploaded by ctooley (license 136)
>        some modifications for trunk by Corydon76
>  Tested by: Corydon76
> 
> Modified:
>     trunk/channels/chan_sip.c


> +/*! \brief Show one peer in detail (main function) */
> +static char *_sip_qualify_peer(int type, int fd, struct mansession *s, const struct message *m, int argc, const char *argv[])
> +{
> +	struct sip_peer *peer;
> +	int load_realtime;
> +
> +	if (argc < 4)
> +		return CLI_SHOWUSAGE;
> +
> +	load_realtime = (argc == 5 && !strcmp(argv[4], "load")) ? TRUE : FALSE;
> +	if ((peer = find_peer(argv[3], NULL, load_realtime))) {
> +		sip_poke_peer(peer, 1);
> +	} else if (type == 0) {
> +		ast_cli(fd, "Peer '%s' not found\n", argv[3]);
> +	} else {
> +		astman_send_error(s, m, "Peer not found\n");
> +	}
> +	return CLI_SUCCESS;
> +}

This code leaks a reference to a peer.  Please add an unref_peer() call after 
sip_poke_peer().

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



More information about the asterisk-dev mailing list