]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If we fail to create a channel after allocating a timing fd, we need to make sure...
authorJason Parker <jparker@digium.com>
Tue, 4 Dec 2007 17:28:08 +0000 (17:28 +0000)
committerJason Parker <jparker@digium.com>
Tue, 4 Dec 2007 17:28:08 +0000 (17:28 +0000)
Issue 11454, patch by eliel.

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

main/channel.c

index 5d16625807e96ac4f5df8c22c44bc844b0b385b0..d242ea17fba1a87a77fe1882b8c34ac47e036f89 100644 (file)
@@ -776,6 +776,10 @@ 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");
+#ifdef HAVE_ZAPTEL
+                       if (tmp->timingfd > -1)
+                               close(tmp->timingfd);
+#endif
                        sched_context_destroy(tmp->sched);
                        ast_string_field_free_memory(tmp);
                        free(tmp);