]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If we fail to setup the PRI request channel, don't continue, exit with an error.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 4 Jun 2008 18:35:47 +0000 (18:35 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 4 Jun 2008 18:35:47 +0000 (18:35 +0000)
(closes issue #11989)
 Reported by: Corydon76
 Patches:
       20080213__zap_memleak.diff.txt uploaded by Corydon76 (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120425 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index e79520c86015d3a8fbfd8d6f34d9d3ba9365d49f..ae7fd750ad67f0834d6e67ac9acea22b19a7a7d5 100644 (file)
@@ -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) {