[asterisk-dev] tilghman: trunk r130126 - in /trunk: ./ channels/chan_agent.c

Russell Bryant russell at digium.com
Sat Jul 12 14:47:29 CDT 2008


On Jul 11, 2008, at 12:29 PM, SVN commits to the Digium repositories  
wrote:
> +	/* Try to be safe, but don't deadlock */
> +	for (i = 0; i < 10; i++) {
> +		if ((res = AST_LIST_TRYLOCK(&agents)) == 0) {
> +			break;
> +		}
> +	}
> +	if (res) {
> +		return;
> +	}
> +
> +	state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);
> +	device = ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE);
> +
> +	if (ast_strlen_zero(device)) {
> +		return;
> +	}


You have a return point right here where the agents list lock is not  
released before returning.

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







More information about the asterisk-dev mailing list