From 087eb40b76d00dab16515ec917085a85c0d7681b Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Sun, 8 May 2005 16:54:53 +0000
Subject: [PATCH] Fix double unlock of hintlock (bug #4205)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 pbx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pbx.c b/pbx.c
index 0f62e58147..b5571aca16 100755
--- a/pbx.c
+++ b/pbx.c
@@ -1919,11 +1919,12 @@ int ast_extension_state_add(const char *context, const char *exten,
 			if (cblist->callback == callback) {
 				cblist->data = data;
 				ast_mutex_unlock(&hintlock);
+				return 0;
 			}
 			cblist = cblist->next;
 		}
 	
-		/* Now inserts the callback */
+		/* Now insert the callback */
 		cblist = malloc(sizeof(struct ast_state_cb));
 		if (!cblist) {
 			ast_mutex_unlock(&hintlock);
-- 
GitLab