mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
When deleting a task from the scheduler, ignoring the return value could
possibly cause memory to be accessed after it is freed, which causes all sorts of random memory corruption. Instead, if a deletion fails, wait a bit and try again (noting that another thread could change our taskid value). (closes issue #11386) Reported by: flujan Patches: 20080124__bug11386.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76, flujan, stuarth` git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -767,17 +767,13 @@ int ast_closestream(struct ast_filestream *f)
|
||||
if (f->owner) {
|
||||
if (f->fmt->format < AST_FORMAT_MAX_AUDIO) {
|
||||
f->owner->stream = NULL;
|
||||
if (f->owner->streamid > -1)
|
||||
ast_sched_del(f->owner->sched, f->owner->streamid);
|
||||
f->owner->streamid = -1;
|
||||
AST_SCHED_DEL(f->owner->sched, f->owner->streamid);
|
||||
#ifdef HAVE_ZAPTEL
|
||||
ast_settimeout(f->owner, 0, NULL, NULL);
|
||||
#endif
|
||||
} else {
|
||||
f->owner->vstream = NULL;
|
||||
if (f->owner->vstreamid > -1)
|
||||
ast_sched_del(f->owner->sched, f->owner->vstreamid);
|
||||
f->owner->vstreamid = -1;
|
||||
AST_SCHED_DEL(f->owner->sched, f->owner->vstreamid);
|
||||
}
|
||||
}
|
||||
/* destroy the translator on exit */
|
||||
|
Reference in New Issue
Block a user