[asterisk-commits] mmichelson: branch mmichelson/queue-penalty r94369 - /team/mmichelson/queue-p...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Dec 20 18:09:27 CST 2007
Author: mmichelson
Date: Thu Dec 20 18:09:26 2007
New Revision: 94369
URL: http://svn.digium.com/view/asterisk?view=rev&rev=94369
Log:
Handle allocation failure when copying rules
Modified:
team/mmichelson/queue-penalty/apps/app_queue.c
Modified: team/mmichelson/queue-penalty/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-penalty/apps/app_queue.c?view=diff&rev=94369&r1=94368&r2=94369
==============================================================================
--- team/mmichelson/queue-penalty/apps/app_queue.c (original)
+++ team/mmichelson/queue-penalty/apps/app_queue.c Thu Dec 20 18:09:26 2007
@@ -4092,6 +4092,11 @@
if (rl_iter) {
AST_LIST_TRAVERSE(&rl_iter->rules, pr_iter, list) {
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;
new_pr->max_value = pr_iter->max_value;
new_pr->min_value = pr_iter->min_value;
More information about the asterisk-commits
mailing list