[asterisk-dev] [asterisk-commits] may: trunk r306499 - /trunk/addons/chan_ooh323.c

Kevin P. Fleming kpfleming at digium.com
Sun Feb 6 00:48:22 CST 2011


On 02/05/2011 11:16 PM, SVN commits to the Asterisk project wrote:
> Author: may
> Date: Sat Feb  5 16:16:07 2011
> New Revision: 306499
>
> URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=306499
> Log:
> fix trivial issue after dvossel patch, initial zero fill user and peer
> structure before cap structure allocated.
>
> Modified:
>      trunk/addons/chan_ooh323.c
>
> Modified: trunk/addons/chan_ooh323.c
> URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=306499&r1=306498&r2=306499
> ==============================================================================
> --- trunk/addons/chan_ooh323.c (original)
> +++ trunk/addons/chan_ooh323.c Sat Feb  5 16:16:07 2011
> @@ -2179,11 +2179,11 @@
>
>      	user = ast_calloc(1,sizeof(struct ooh323_user));
>   	if (user) {
> +		memset(user, 0, sizeof(struct ooh323_user));
>   		if (!(user->cap = ast_format_cap_alloc_nolock())) {
>   			ast_free(user);
>   			return NULL;
>   		}
> -		memset(user, 0, sizeof(struct ooh323_user));
>   		ast_mutex_init(&user->lock);
>   		ast_copy_string(user->name, name, sizeof(user->name));
>   		ast_format_cap_copy(user->cap, gCap);

This cannot be the real fix for whatever problem you are seeing... you 
are allocating the structure using ast_calloc(), which returns 
zero-filled memory. Setting it to zero again isn't going to accomplish 
much :-)

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list