Check registry carefully before unlinking

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-10-01 04:53:53 +00:00
parent d3e0c54f7d
commit 9e68716e0e

View File

@@ -889,7 +889,14 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner)
p->route = NULL;
}
if (p->registry) {
p->registry->call=NULL;
/* Carefully unlink from registry */
struct sip_registry *reg;
reg = registrations;
while(reg) {
if ((reg == p->registry) && (p->registry->call == p))
p->registry->call=NULL;
reg = reg->next;
}
}
/* Unlink us from the owner if we have one */
if (p->owner) {