summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-03-31 07:16:10 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-03-31 07:16:10 -0500
commit2b5dfe668a61cf5eb02e693a39b9c82089a35412 (patch)
treeb6320a63fd7cf1f9656c8cf0a2f306b7c7f51b4c /res
parent6ad59a69f8265220082935c02c7ae01896674b8e (diff)
parentcf49b440904d667c46319e2747da617a802f46d2 (diff)
Merge "res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name()." into 13
Diffstat (limited to 'res')
-rw-r--r--res/res_stasis_recording.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/res/res_stasis_recording.c b/res/res_stasis_recording.c
index 392d92c8e..05b97bf69 100644
--- a/res/res_stasis_recording.c
+++ b/res/res_stasis_recording.c
@@ -265,7 +265,13 @@ static enum stasis_app_control_channel_result check_rule_recording(
return STASIS_APP_CHANNEL_RECORDING;
}
-struct stasis_app_control_rule rule_recording = {
+/*
+ * XXX This only works because there is one and only one rule in
+ * the system so it can be added to any number of channels
+ * without issue. However, as soon as there is another rule then
+ * watch out for weirdness because of cross linked lists.
+ */
+static struct stasis_app_control_rule rule_recording = {
.check_rule = check_rule_recording
};
@@ -465,15 +471,7 @@ const char *stasis_app_recording_get_name(
struct stasis_app_recording *stasis_app_recording_find_by_name(const char *name)
{
- RAII_VAR(struct stasis_app_recording *, recording, NULL, ao2_cleanup);
-
- recording = ao2_find(recordings, name, OBJ_KEY);
- if (recording == NULL) {
- return NULL;
- }
-
- ao2_ref(recording, +1);
- return recording;
+ return ao2_find(recordings, name, OBJ_KEY);
}
struct ast_json *stasis_app_recording_to_json(