]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix up another potential race condition. Do the loop decrementing use count
authorRussell Bryant <russell@russellbryant.com>
Wed, 19 Sep 2007 15:10:14 +0000 (15:10 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 19 Sep 2007 15:10:14 +0000 (15:10 +0000)
on events with the eventq protected from being changed.
(reported on IRC by Ivan)

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

main/manager.c

index 1964bfdfd89a11813b2b07f6c679c504b3bb2a3c..d39de80617d7616ef460bf6870439b4f8e95eb1d 100644 (file)
@@ -684,9 +684,8 @@ static void destroy_session(struct mansession *s)
        AST_LIST_LOCK(&sessions);
        AST_LIST_REMOVE(&sessions, s, list);
        num_sessions--;
-       AST_LIST_UNLOCK(&sessions);
-
        free_session(s);
+       AST_LIST_UNLOCK(&sessions);
 }
 
 const char *astman_get_header(const struct message *m, char *var)