From f392ba9da83737c5f0d0184875e7c185c4e0f2fd Mon Sep 17 00:00:00 2001 From: russell Date: Thu, 24 May 2007 22:25:55 +0000 Subject: [PATCH] Merged revisions 66076 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r66076 | russell | 2007-05-24 17:23:59 -0500 (Thu, 24 May 2007) | 1 line if the string field init fails, clean up the stuff that was allocated already ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@66077 f38db490-d61c-443f-a65b-d21fe96a405b --- main/channel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/channel.c b/main/channel.c index 6522837ed..d75e98306 100644 --- a/main/channel.c +++ b/main/channel.c @@ -652,8 +652,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,