aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 22:23:59 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 22:23:59 +0000
commit6b8794ea03cf139278132b37c4f6889fcd142280 (patch)
treefc1dc84aad0322ec57a79acb017fc9e454d3be30 /main/channel.c
parent1984fd50d376d55715e71ecbf0bb088ac918ed5a (diff)
if the string field init fails, clean up the stuff that was allocated already
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@66076 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index f7def7e90..d830f1f8b 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -742,8 +742,11 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_
return NULL;
}
- if ((ast_string_field_init(tmp, 128)))
+ if ((ast_string_field_init(tmp, 128))) {
+ sched_context_destroy(tmp->sched);
+ free(tmp);
return NULL;
+ }
/* Don't bother initializing the last two FD here, because they
will *always* be set just a few lines down (AST_TIMING_FD,