diff --git a/channels/chan_zap.c b/channels/chan_zap.c index e79520c860..ae7fd750ad 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -2102,8 +2102,11 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout) } if (!(sr = pri_sr_new())) { ast_log(LOG_WARNING, "Failed to allocate setup request channel %d\n", p->channel); + pri_destroycall(p->pri->pri, p->call); + p->call = NULL; pri_rel(p->pri); ast_mutex_unlock(&p->lock); + return -1; } if (p->bearer || (mysig == SIG_FXSKS)) { if (p->bearer) {