Audit improper usage of scheduler exposed by 5c713fdf18.

channels/chan_iax2.c:
* Initialize struct chan_iax2_pvt scheduler ids earlier because of
iax2_destroy_helper().

channels/chan_sip.c:
channels/sip/config_parser.c:
* Fix initialization of scheduler id struct members.  Some off nominal
paths had 0 as a scheduler id to be destroyed when it was never started.

chan_skinny.c:
* Fix some scheduler id comparisons that excluded the valid 0 id.

channel.c:
* Fix channel initialization of the video stream scheduler id.

pbx_dundi.c:
* Fix channel initialization of the packet retransmission scheduler id.

ASTERISK-25476

Change-Id: I07a3449f728f671d326a22fcbd071f150ba2e8c8
This commit is contained in:
Richard Mudgett
2015-11-24 12:44:53 -06:00
parent 3fcf160fae
commit 6d9156d10f
6 changed files with 27 additions and 15 deletions

View File

@@ -1708,6 +1708,7 @@ static int publish_expire(const void *data)
ast_assert(esc != NULL);
ao2_unlink(esc->compositor, esc_entry);
esc_entry->sched_id = -1;
ao2_ref(esc_entry, -1);
return 0;
}
@@ -1740,6 +1741,11 @@ static struct sip_esc_entry *create_esc_entry(struct event_state_compositor *esc
/* Bump refcount for scheduler */
ao2_ref(esc_entry, +1);
esc_entry->sched_id = ast_sched_add(sched, expires_ms, publish_expire, esc_entry);
if (esc_entry->sched_id == -1) {
ao2_ref(esc_entry, -1);
ao2_ref(esc_entry, -1);
return NULL;
}
/* Note: This links the esc_entry into the ESC properly */
create_new_sip_etag(esc_entry, 0);