Review Board 1.7.16


chan_sip: Fix dialog reference leaked to scheduler for reinvite_timeout.

Review Request #4491 - Created March 14, 2015 and submitted

Corey Farrell
11, 13, trunk
ASTERISK-24876
Reviewers
asterisk-dev
Asterisk
This leak was found by tests/channels/local/local_optimize_away (13+).  Scheduler reference to dialog for reinvite timeout is not released during dialog_unlink_all.

This issue likely only applies when the system is shutdown before the reinvite timeout expires.
No more leaks for tests/channels/local/local_optimize_away on 13.

Diff revision 1 (Latest)

  1. /branches/11/channels/chan_sip.c: Loading...
/branches/11/channels/chan_sip.c
Revision 432991 New Change
[20] 3284 lines
[+20] [+] void dialog_unlink_all(struct sip_pvt *dialog)
3285
	}
3285
	}
3286

    
   
3286

   
3287
	AST_SCHED_DEL_UNREF(sched, dialog->waitid, dialog_unref(dialog, "when you delete the waitid sched, you should dec the refcount for the stored dialog ptr"));
3287
	AST_SCHED_DEL_UNREF(sched, dialog->waitid, dialog_unref(dialog, "when you delete the waitid sched, you should dec the refcount for the stored dialog ptr"));
3288

    
   
3288

   
3289
	AST_SCHED_DEL_UNREF(sched, dialog->initid, dialog_unref(dialog, "when you delete the initid sched, you should dec the refcount for the stored dialog ptr"));
3289
	AST_SCHED_DEL_UNREF(sched, dialog->initid, dialog_unref(dialog, "when you delete the initid sched, you should dec the refcount for the stored dialog ptr"));
3290
	
3290

   

    
   
3291
	if (dialog->reinviteid > -1) {

    
   
3292
		AST_SCHED_DEL_UNREF(sched, dialog->reinviteid, dialog_unref(dialog, "clear ref for reinvite_timeout"));

    
   
3293
	}

    
   
3294

   
3291
	if (dialog->autokillid > -1) {
3295
	if (dialog->autokillid > -1) {
3292
		AST_SCHED_DEL_UNREF(sched, dialog->autokillid, dialog_unref(dialog, "when you delete the autokillid sched, you should dec the refcount for the stored dialog ptr"));
3296
		AST_SCHED_DEL_UNREF(sched, dialog->autokillid, dialog_unref(dialog, "when you delete the autokillid sched, you should dec the refcount for the stored dialog ptr"));
3293
	}
3297
	}
3294

    
   
3298

   
3295
	if (dialog->request_queue_sched_id > -1) {
3299
	if (dialog->request_queue_sched_id > -1) {
[+20] [20] 31777 lines
  1. /branches/11/channels/chan_sip.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.