aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-06 17:50:55 +0000
committermattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-06 17:50:55 +0000
commit9d390fa52bf11141ea210e02e4894d7f6e18a339 (patch)
tree2f9afcc870ce9fdb03c79a08a6618f55eca9c709 /channels
parente565b26978a8645e2deb0554db3f80339506a455 (diff)
Fixed possible hangup race condition that would lead to segfualt with hangups.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6516 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 0222adf83..6bf8f6398 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -2347,6 +2347,7 @@ static int zt_hangup(struct ast_channel *ast)
icause = atoi(cause);
}
pri_hangup(p->pri->pri, p->call, icause);
+ p->call = NULL;
}
if (res < 0)
ast_log(LOG_WARNING, "pri_disconnect failed\n");
@@ -3463,6 +3464,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
if (!pri_grab(p, p->pri)) {
pri_hangup(p->pri->pri, p->call, -1);
pri_destroycall(p->pri->pri, p->call);
+ p->call = NULL;
pri_rel(p->pri);
} else
ast_log(LOG_WARNING, "Failed to grab PRI!\n");
@@ -3471,7 +3473,6 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
}
if (p->owner)
p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
- p->call = NULL;
if (p->bearer)
p->bearer->inalarm = 1;
else