[asterisk-dev] [asterisk-commits] file: trunk r71425 - in /trunk: ./ main/cdr.c

Luigi Rizzo rizzo at icir.org
Mon Jun 25 00:57:10 CDT 2007


On Mon, Jun 25, 2007 at 01:08:22AM -0000, SVN commits to the Asterisk project wrote:
...
> Modified: trunk/main/cdr.c
> URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=71425&r1=71424&r2=71425
> ==============================================================================
> --- trunk/main/cdr.c (original)
> +++ trunk/main/cdr.c Sun Jun 24 20:08:22 2007
> @@ -528,7 +528,7 @@
>  	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED)) {
>  		discard_from = 1;
>  		if (lto) {
> -			struct ast_cdr *llfrom;
> +			struct ast_cdr *llfrom = NULL;
>  			/* insert the from stuff after lto */
>  			lto->next = from;
>  			lfrom = from;
> @@ -543,7 +543,7 @@
>  		} else {
>  			/* save copy of the current *to cdr */
>  			struct ast_cdr tcdr;
> -			struct ast_cdr *llfrom;
> +			struct ast_cdr *llfrom = NULL;
>  			memcpy(&tcdr, to, sizeof(tcdr));
>  			/* copy in the locked from cdr */
>  			memcpy(to, from, sizeof(*to));

you can probably bring the declaration of llfrom right before
	discard_from = 1;
since the variable is used in both branches of the if/then/else

	cheers
	luigi



More information about the asterisk-dev mailing list