summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/ari/resource_endpoints.c10
-rw-r--r--res/res_fax.c1
-rw-r--r--res/res_sorcery_astdb.c1
-rw-r--r--res/res_stasis_recording.c1
4 files changed, 2 insertions, 11 deletions
diff --git a/res/ari/resource_endpoints.c b/res/ari/resource_endpoints.c
index 2f47b1a1a..16b7ebd8d 100644
--- a/res/ari/resource_endpoints.c
+++ b/res/ari/resource_endpoints.c
@@ -71,16 +71,8 @@ void ast_ari_endpoints_list(struct ast_variable *headers,
RAII_VAR(struct stasis_message *, msg, obj, ao2_cleanup);
struct ast_endpoint_snapshot *snapshot = stasis_message_data(msg);
struct ast_json *json_endpoint = ast_endpoint_snapshot_to_json(snapshot, stasis_app_get_sanitizer());
- int r;
- if (!json_endpoint) {
- ao2_iterator_destroy(&i);
- return;
- }
-
- r = ast_json_array_append(
- json, json_endpoint);
- if (r != 0) {
+ if (!json_endpoint || ast_json_array_append(json, json_endpoint)) {
ao2_iterator_destroy(&i);
ast_ari_response_alloc_failed(response);
return;
diff --git a/res/res_fax.c b/res/res_fax.c
index c4e64cd71..e05b101f7 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -1774,6 +1774,7 @@ static int report_receive_fax_status(struct ast_channel *chan, const char *filen
struct ast_json *json_filename = ast_json_string_create(filename);
if (!json_array || !json_filename) {
+ ast_json_unref(json_filename);
return -1;
}
ast_json_array_append(json_array, json_filename);
diff --git a/res/res_sorcery_astdb.c b/res/res_sorcery_astdb.c
index 10d881e8f..d04153ea2 100644
--- a/res/res_sorcery_astdb.c
+++ b/res/res_sorcery_astdb.c
@@ -76,7 +76,6 @@ static struct ast_json *sorcery_objectset_to_json(const struct ast_variable *obj
ast_json_unref(json);
return NULL;
} else if (ast_json_object_set(json, field->name, value)) {
- ast_json_unref(value);
ast_json_unref(json);
return NULL;
}
diff --git a/res/res_stasis_recording.c b/res/res_stasis_recording.c
index f0fa1e5f6..0dee1e5be 100644
--- a/res/res_stasis_recording.c
+++ b/res/res_stasis_recording.c
@@ -229,7 +229,6 @@ static void recording_publish(struct stasis_app_recording *recording, const char
}
if (ast_json_object_set(json, "cause", failure_cause)) {
- ast_json_unref(failure_cause);
return;
}
}