summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
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(