Added some locks that should have been around astman_send_error,
authorMark Michelson <mmichelson@digium.com>
Fri, 16 Nov 2007 19:41:15 +0000 (19:41 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 16 Nov 2007 19:41:15 +0000 (19:41 +0000)
at least according to the comments.

(closes issue #11258, reported and patched by eliel)

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

main/manager.c

index e1bc932..e4d93ac 100644 (file)
@@ -2384,7 +2384,9 @@ static int process_message(struct mansession *s, const struct message *m)
        ast_debug(1, "Manager received command '%s'\n", action);
 
        if (ast_strlen_zero(action)) {
+               ast_mutex_lock(&s->__lock);
                astman_send_error(s, m, "Missing action in request");
+               ast_mutex_unlock(&s->__lock);
                return 0;
        }
 
@@ -2399,7 +2401,9 @@ static int process_message(struct mansession *s, const struct message *m)
                (!strcasecmp(action, "Login") || !strcasecmp(action, "Challenge"))) {
                if (check_manager_session_inuse(user)) {
                        sleep(1);
+                       ast_mutex_lock(&s->__lock);
                        astman_send_error(s, m, "Login Already In Use");
+                       ast_mutex_lock(&s->__lock);
                        return -1;
                }
        }