diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-02 18:18:52 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-02 18:18:52 +0000 |
commit | 7fee69213a7d9da33da410f09f97885a4fe693b9 (patch) | |
tree | 7de8ac155fa1e4147d705677fc029b55ed9639b8 /apps | |
parent | 6b4f71fc4c88aa11eb8ab8da76c98172ae10da68 (diff) |
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)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90470 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_queue.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index bee1997ac..db4a574ba 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3038,8 +3038,6 @@ static int add_to_queue(const char *queuename, const char *interface, const char 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" @@ -3056,6 +3054,9 @@ static int add_to_queue(const char *queuename, const char *interface, const char 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); |