]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If channel allocation fails because the alert pipe could not be created also free...
authorJoshua Colp <jcolp@digium.com>
Mon, 26 Nov 2007 15:34:38 +0000 (15:34 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 26 Nov 2007 15:34:38 +0000 (15:34 +0000)
(closes issue #11355)
Reported by: eliel
Patches:
      main.channel.c.patch uploaded by eliel (license 64)

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

main/channel.c

index c9de79bc07fabcedcab5af86baca27e6165a4013..ce9f2ce7489b2102d60917681cf820f63f2f9e66 100644 (file)
@@ -776,6 +776,7 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_
        if (needqueue) {
                if (pipe(tmp->alertpipe)) {
                        ast_log(LOG_WARNING, "Channel allocation failed: Can't create alert pipe!\n");
+                       sched_context_destroy(tmp->sched);
                        ast_string_field_free_memory(tmp);
                        free(tmp);
                        return NULL;