[asterisk-commits] branch 1.2 - r7521 /branches/1.2/cdr.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Dec 18 23:38:45 CST 2005


Author: tilghman
Date: Sun Dec 18 23:38:44 2005
New Revision: 7521

URL: http://svn.digium.com/view/asterisk?rev=7521&view=rev
Log:
Bug 6026 - segfault for the sequence NoCDR(), SetAMAFlags()

Modified:
    branches/1.2/cdr.c

Modified: branches/1.2/cdr.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/cdr.c?rev=7521&r1=7520&r2=7521&view=diff
==============================================================================
--- branches/1.2/cdr.c (original)
+++ branches/1.2/cdr.c Sun Dec 18 23:38:44 2005
@@ -710,12 +710,15 @@
 
 int ast_cdr_setamaflags(struct ast_channel *chan, const char *flag)
 {
-	struct ast_cdr *cdr = chan->cdr;
+	struct ast_cdr *cdr;
 	int newflag;
 
 	newflag = ast_cdr_amaflags2int(flag);
-	if (newflag)
-		cdr->amaflags = newflag;
+	if (newflag) {
+		for (cdr = chan->cdr; cdr; cdr = cdr->next) {
+			cdr->amaflags = newflag;
+		}
+	}
 
 	return 0;
 }



More information about the asterisk-commits mailing list