[asterisk-commits] russell: trunk r90471 - in /trunk: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 2 12:20:13 CST 2007


Author: russell
Date: Sun Dec  2 12:20:13 2007
New Revision: 90471

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90471
Log:
Merged revisions 90470 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90470 | russell | 2007-12-02 12:18:52 -0600 (Sun, 02 Dec 2007) | 6 lines

The other day when I went through making changes as a result of the ao2_link()
change, I added some code to set pointers to NULL after they were unreferenced.
This pointed out that in this place, the object was unreferenced before the
code was done using it.  So, move the unref down a little bit.
(crash reported by jmls on IRC)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=90471&r1=90470&r2=90471
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Sun Dec  2 12:20:13 2007
@@ -3384,8 +3384,6 @@
 		if ((new_member = create_queue_member(interface, membername, penalty, paused))) {
 			new_member->dynamic = 1;
 			ao2_link(q->members, new_member);
-			ao2_ref(new_member, -1);
-			new_member = NULL;
 			q->membercount++;
 			manager_event(EVENT_FLAG_AGENT, "QueueMemberAdded",
 				"Queue: %s\r\n"
@@ -3402,6 +3400,9 @@
 				new_member->penalty, new_member->calls, (int) new_member->lastcall,
 				new_member->status, new_member->paused);
 			
+			ao2_ref(new_member, -1);
+			new_member = NULL;
+
 			if (dump)
 				dump_queue_members(q);
 			




More information about the asterisk-commits mailing list