diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ec18409aad3b1584faf0a03446b8289eceeb68a1..df04adb3964666e5fcf9d0099f35424c7812f29b 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1359,7 +1359,10 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si p = p->next; } ast_pthread_mutex_unlock(&iflock); - return sip_alloc(callid, sin, 1); + p = sip_alloc(callid, sin, 1); + if (p) + ast_pthread_mutex_lock(&p->lock); + return p; } static int sip_register(char *value, int lineno)