From: Olle Johansson Date: Thu, 16 Nov 2006 16:44:56 +0000 (+0000) Subject: Don't fixup if we haven't got PVT. Suggestion from Martin Vit on -dev mailing list... X-Git-Tag: 1.2.14~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08570a508014d927458bb613dd48f863431d2214;p=thirdparty%2Fasterisk.git Don't fixup if we haven't got PVT. Suggestion from Martin Vit on -dev mailing list inspired by file's commit to chan_local. "This shouldn't happen" ;-) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47743 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 19ef6e0a2e..1088e7c8ac 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2619,6 +2619,11 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame) static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) { struct sip_pvt *p = newchan->tech_pvt; + if (!p) { + ast_log(LOG_WARNING, "No pvt after masquerade. Strange things may happen\n"); + return -1; + } + ast_mutex_lock(&p->lock); if (p->owner != oldchan) { ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);