[asterisk-commits] twilson: trunk r297956 - in /trunk: ./ main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 9 15:26:22 CST 2010


Author: twilson
Date: Thu Dec  9 15:26:19 2010
New Revision: 297956

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=297956
Log:
Merged revisions 297952 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r297952 | twilson | 2010-12-09 14:48:44 -0600 (Thu, 09 Dec 2010) | 10 lines
  
  Don't crash after Set(CDR(userfield)=...) in ast_bridge_call
  
  Instead of setting peer->cdr = NULL, set it to not post.
  
  (closes issue #18415)
  Reported by: macbrody
  Patches: 
        patch-18415 uploaded by jsolares (license 1167)
  Tested by: jsolares, twilson
........

Modified:
    trunk/   (props changed)
    trunk/main/features.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=297956&r1=297955&r2=297956
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Thu Dec  9 15:26:19 2010
@@ -3091,6 +3091,7 @@
 	int hasfeatures=0;
 	int hadfeatures=0;
 	int autoloopflag;
+	int we_disabled_peer_cdr = 0;
 	struct ast_option_header *aoh;
 	struct ast_cdr *bridge_cdr = NULL;
 	struct ast_cdr *orig_peer_cdr = NULL;
@@ -3158,9 +3159,9 @@
 			ast_cdr_appenduserfield(chan, tmp);
 		} else
 			ast_cdr_setuserfield(chan, peer->cdr->userfield);
-		/* free the peer's cdr without ast_cdr_free complaining */
-		ast_free(peer->cdr);
-		peer->cdr = NULL;
+		/* Don't delete the CDR; just disable it. */
+		ast_set_flag(peer->cdr, AST_CDR_FLAG_POST_DISABLED);
+		we_disabled_peer_cdr = 1;
 	}
 	ast_copy_string(orig_channame,chan->name,sizeof(orig_channame));
 	ast_copy_string(orig_peername,peer->name,sizeof(orig_peername));
@@ -3600,6 +3601,9 @@
 				ast_cdr_specialized_reset(new_peer_cdr, 0);
 			}
 		} else {
+			if (we_disabled_peer_cdr) {
+				ast_clear_flag(peer->cdr, AST_CDR_FLAG_POST_DISABLED);
+			}
 			ast_cdr_specialized_reset(peer->cdr, 0); /* nothing changed, reset the peer cdr  */
 		}
 	}




More information about the asterisk-commits mailing list