aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-16 16:44:56 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-16 16:44:56 +0000
commitaa106ce296e1d000ee0c2c2c44aa1dbdff02d44c (patch)
treea4f4cda4cb1b9402fbaa83e96e09d4e0c1b0c5bb /channels
parent539ba4801e1d0eaa2a65ec2b0de13948e4b77419 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.2@47743 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 19ef6e0a2..1088e7c8a 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);