diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2018-01-08 11:25:45 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2018-01-08 11:25:45 -0600 |
commit | 8e18209cadf094fc0e1dec4c7375073864b611a9 (patch) | |
tree | f224072c0b9d112ad37bf7840184d001d873287d /res | |
parent | 94e7a7675b6f38d3d11bb04c5336a3278376fc41 (diff) | |
parent | 6870ba5f26ff2019202168c99715c3aa7b6cd7d4 (diff) |
Merge "res_stasis: Fix app_is_subscribed_bridge_id."
Diffstat (limited to 'res')
-rw-r--r-- | res/stasis/app.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/res/stasis/app.c b/res/stasis/app.c index 667636ec0..5382aef1c 100644 --- a/res/stasis/app.c +++ b/res/stasis/app.c @@ -1429,25 +1429,15 @@ int app_unsubscribe_bridge_id(struct stasis_app *app, const char *bridge_id) int app_is_subscribed_bridge_id(struct stasis_app *app, const char *bridge_id) { struct app_forwards *forwards; - SCOPED_AO2LOCK(lock, app->forwards); - - forwards = ao2_find(app->forwards, BRIDGE_ALL, OBJ_SEARCH_KEY | OBJ_NOLOCK); - if (forwards) { - ao2_ref(forwards, -1); - return 1; - } if (ast_strlen_zero(bridge_id)) { bridge_id = BRIDGE_ALL; } - forwards = ao2_find(app->forwards, bridge_id, OBJ_SEARCH_KEY | OBJ_NOLOCK); - if (forwards) { - ao2_ref(forwards, -1); - return 1; - } + forwards = ao2_find(app->forwards, bridge_id, OBJ_SEARCH_KEY); + ao2_cleanup(forwards); - return 0; + return forwards != NULL; } static void *bridge_find(const struct stasis_app *app, const char *id) |