[asterisk-commits] mmichelson: branch 1.6.0 r179220 - in /branches/1.6.0: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 1 15:52:44 CST 2009


Author: mmichelson
Date: Sun Mar  1 15:52:39 2009
New Revision: 179220

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179220
Log:
Merged revisions 179219 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r179219 | mmichelson | 2009-03-01 15:45:08 -0600 (Sun, 01 Mar 2009) | 18 lines
  
  Properly free memory and remove scheduler entries when a transmission failure occurs.
  
  Previously, only the "data" field of the sip_pkt created during __sip_reliable_xmit 
  was freed when XMIT_FAILURE was returned by __sip_xmit. When retrans_pkt was called,
  this inevitably resulted in the reading and writing of freed memory.
  
  XMIT_FAILURE is a condition meaning that we don't want to attempt resending the packet
  at all. The proper action to take is to remove the scheduler entry we just created,
  free the packet's data as well as the packet itself, and unlink it from the list of
  packets on the sip_pvt structure.
  
  (closes issue #14455)
  Reported by: Nick_Lewis
  Patches:
        14455.patch uploaded by mmichelson (license 60)
  Tested by: Nick_Lewis
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=179220&r1=179219&r2=179220
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Sun Mar  1 15:52:39 2009
@@ -2919,6 +2919,11 @@
 
 	if (xmitres == XMIT_ERROR) {	/* Serious network trouble, no need to try again */
 		append_history(pkt->owner, "XmitErr", "%s", pkt->is_fatal ? "(Critical)" : "(Non-critical)");
+		ast_log(LOG_ERROR, "Serious Network Trouble; __sip_xmit returns error for pkt data\n");
+		AST_SCHED_DEL(sched, pkt->retransid);
+		p->packets = pkt->next;
+		ast_free(pkt->data);
+		ast_free(pkt);
 		return AST_FAILURE;
 	} else {
 		return AST_SUCCESS;




More information about the asterisk-commits mailing list