mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Fix potential seg in iax2 from reload when registrations are going
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -6076,8 +6076,18 @@ static void delete_users(void)
|
||||
for (reg = registrations;reg;) {
|
||||
regl = reg;
|
||||
reg = reg->next;
|
||||
if (regl->expire > -1)
|
||||
if (regl->expire > -1) {
|
||||
ast_sched_del(sched, regl->expire);
|
||||
}
|
||||
if (regl->callno) {
|
||||
/* XXX Is this a potential lock? I don't think so, but you never know */
|
||||
ast_mutex_lock(&iaxsl[regl->callno]);
|
||||
if (iaxs[regl->callno]) {
|
||||
iaxs[regl->callno]->reg = NULL;
|
||||
iax2_destroy_nolock(regl->callno);
|
||||
}
|
||||
ast_mutex_unlock(&iaxsl[regl->callno]);
|
||||
}
|
||||
free(regl);
|
||||
}
|
||||
registrations = NULL;
|
||||
|
Reference in New Issue
Block a user