mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 12:52:33 +00:00
Fix potential segfault in chan_sip
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -362,14 +362,26 @@ static int retrans_pkt(void *data)
|
||||
ast_queue_hangup(pkt->owner->owner, 1);
|
||||
} else {
|
||||
/* If no owner, destroy now */
|
||||
ast_pthread_mutex_unlock(&pkt->owner->lock);
|
||||
sip_destroy(pkt->owner);
|
||||
pkt = NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Don't bother retransmitting. It's about to be killed anyway */
|
||||
pkt->retransid = -1;
|
||||
if (pkt->owner->owner) {
|
||||
/* XXX Potential deadlocK?? XXX */
|
||||
ast_queue_hangup(pkt->owner->owner, 1);
|
||||
} else {
|
||||
/* If no owner, destroy now */
|
||||
ast_pthread_mutex_unlock(&pkt->owner->lock);
|
||||
sip_destroy(pkt->owner);
|
||||
pkt=NULL;
|
||||
}
|
||||
}
|
||||
ast_pthread_mutex_unlock(&pkt->owner->lock);
|
||||
if (pkt)
|
||||
ast_pthread_mutex_unlock(&pkt->owner->lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2179,7 +2191,7 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth)
|
||||
char addr[80];
|
||||
struct sip_pvt *p;
|
||||
/* exit if we are already in process with this registrar ?*/
|
||||
if ( (auth==NULL && r->regstate==REG_STATE_REGSENT) || r->regstate==REG_STATE_AUTHSENT) {
|
||||
if ( r == NULL || (auth==NULL && r->regstate==REG_STATE_REGSENT) || r->regstate==REG_STATE_AUTHSENT) {
|
||||
ast_log(LOG_NOTICE, "Strange, trying to register when registration already pending\n");
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user