From: Richard Mudgett Date: Wed, 29 Jun 2011 18:16:45 +0000 (+0000) Subject: Fixed some error exit cleanup in app_queue.c. X-Git-Tag: 1.8.5-rc1~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fe435117697ecfa903458ea18d364dfc383bf22;p=thirdparty%2Fasterisk.git Fixed some error exit cleanup in app_queue.c. * Fixed error exit cleanup in app_queue.c copy_rules() and reload_queue_rules(). git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@325614 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index ac5d83d8ef..66de657947 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1759,7 +1759,7 @@ static void clear_queue(struct call_queue *q) * \retval 0 on success * \note Call this with the rule_lists locked */ -static int insert_penaltychange (const char *list_name, const char *content, const int linenum) +static int insert_penaltychange(const char *list_name, const char *content, const int linenum) { char *timestr, *maxstr, *minstr, *contentdup; struct penalty_rule *rule = NULL, *rule_iter; @@ -5772,7 +5772,6 @@ static void copy_rules(struct queue_ent *qe, const char *rulename) struct penalty_rule *new_pr = ast_calloc(1, sizeof(*new_pr)); if (!new_pr) { ast_log(LOG_ERROR, "Memory allocation error when copying penalty rules! Aborting!\n"); - AST_LIST_UNLOCK(&rule_lists); break; } new_pr->time = pr_iter->time; @@ -6497,6 +6496,7 @@ static int reload_queue_rules(int reload) while ((rulecat = ast_category_browse(cfg, rulecat))) { if (!(new_rl = ast_calloc(1, sizeof(*new_rl)))) { AST_LIST_UNLOCK(&rule_lists); + ast_config_destroy(cfg); return AST_MODULE_LOAD_FAILURE; } else { ast_copy_string(new_rl->name, rulecat, sizeof(new_rl->name));