]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix for ConfBridge config parser unlocking channel mutex too many times
authorMatthew Jordan <mjordan@digium.com>
Wed, 4 Jan 2012 22:19:34 +0000 (22:19 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 4 Jan 2012 22:19:34 +0000 (22:19 +0000)
When looking up a ConfBridge profile, the config parser would, if it
found a channel datastore on the channel requesting the bridge profile,
unlock the channel mutex twice.  Since that's a little aggressive,
it now only unlocks it once.

(closes issue ASTERISK-19042)
Reported by: Matt Jordan
Tested by: Matt Jordan
Patches:
  19042 uploaded by David Vossel (license 5628)

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

apps/confbridge/conf_config_parser.c

index 73c9d69a58dae667d1a028c62fb7326a52755b29..a92495c3c60687f0d71282d67e97e57f042f4b0b 100644 (file)
@@ -1312,8 +1312,9 @@ const struct user_profile *conf_find_user_profile(struct ast_channel *chan, cons
                                conf_user_profile_copy(result, &b_data->u_profile);
                                return result;
                        }
+               } else {
+                       ast_channel_unlock(chan);
                }
-               ast_channel_unlock(chan);
        }
 
        if (ast_strlen_zero(user_profile_name)) {
@@ -1362,8 +1363,9 @@ const struct bridge_profile *conf_find_bridge_profile(struct ast_channel *chan,
                                conf_bridge_profile_copy(result, &b_data->b_profile);
                                return result;
                        }
+               } else {
+                       ast_channel_unlock(chan);
                }
-               ast_channel_unlock(chan);
        }
        if (ast_strlen_zero(bridge_profile_name)) {
                bridge_profile_name = DEFAULT_BRIDGE_PROFILE;