[asterisk-commits] mmichelson: branch mmichelson/queue-reset r166976 - /team/mmichelson/queue-re...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 31 14:24:13 CST 2008


Author: mmichelson
Date: Wed Dec 31 14:24:13 2008
New Revision: 166976

URL: http://svn.digium.com/view/asterisk?view=rev&rev=166976
Log:
Add error checking in a place that could otherwise blow up.


Modified:
    team/mmichelson/queue-reset/apps/app_queue.c

Modified: team/mmichelson/queue-reset/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/apps/app_queue.c?view=diff&rev=166976&r1=166975&r2=166976
==============================================================================
--- team/mmichelson/queue-reset/apps/app_queue.c (original)
+++ team/mmichelson/queue-reset/apps/app_queue.c Wed Dec 31 14:24:13 2008
@@ -5550,9 +5550,10 @@
 	/* Find the old position in the list */
 	ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
 	cur = ao2_find(q->members, &tmpmem, OBJ_POINTER | OBJ_UNLINK);
-	newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, state_interface);
-	ao2_link(q->members, newm);
-	ao2_ref(newm, -1);
+	if ((newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, state_interface))) {
+		ao2_link(q->members, newm);
+		ao2_ref(newm, -1);
+	}
 	newm = NULL;
 
 	if (cur) {




More information about the asterisk-commits mailing list