]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't dec the usecount of an eventqent then use it.
authorMatthew Nicholson <mnicholson@digium.com>
Thu, 17 Mar 2011 19:09:37 +0000 (19:09 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Thu, 17 Mar 2011 19:09:37 +0000 (19:09 +0000)
ABE-2756

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@311201 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index 700cdd8ebe486f944a7daf3781a548039e1d6c93..6d0bfae517bbb8c41032b00c42ed9838657f9503 100644 (file)
@@ -784,7 +784,8 @@ static struct ast_cli_entry cli_manager[] = {
 
 static void unuse_eventqent(struct eventqent *e)
 {
-       if (ast_atomic_dec_and_test(&e->usecount) && e->next)
+       struct eventqent *next = e->next;
+       if (ast_atomic_dec_and_test(&e->usecount) && next)
                pthread_kill(t, SIGURG);
 }