From cd56d84085261f6388a980d45b7e1045b290efb8 Mon Sep 17 00:00:00 2001
From: Joshua Colp <jcolp@digium.com>
Date: Fri, 16 Feb 2007 00:10:17 +0000
Subject: [PATCH] Properly handle an error result from a manager action. This
 could have left the action list permanently locked for reading.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/manager.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/main/manager.c b/main/manager.c
index bdb17f8f9e..c1b09c2cb6 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -2091,11 +2091,9 @@ static int process_message(struct mansession *s, const struct message *m)
 	for (tmp = first_action ; tmp; tmp = tmp->next) {
 		if (strcasecmp(action, tmp->action))
 			continue;
-		if ((s->writeperm & tmp->authority) == tmp->authority) {
-			if (tmp->func(s, m)) {	/* error */
-				return -1;
-			}
-		} else
+		if ((s->writeperm & tmp->authority) == tmp->authority)
+			ret = tmp->func(s, m);
+		else
 			astman_send_error(s, m, "Permission denied");
 		break;
 	}
-- 
GitLab