summaryrefslogtreecommitdiff
path: root/res/res_ari.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-11-06 08:15:02 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-11-06 08:15:03 -0600
commit3c6fe0545abffd07da0583df07611d5cfac6bc85 (patch)
treec47cb0f24caa3675a7a34ffeba1d3f2ef56347de /res/res_ari.c
parent036bbe2d3faa48e102584e763bcbd1552150391d (diff)
parent79ddcdbc70d5e9580cb67b060efacf6d443b1e54 (diff)
Merge "Stasis/ARI: Fix off-nominal path json memory leaks."
Diffstat (limited to 'res/res_ari.c')
-rw-r--r--res/res_ari.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_ari.c b/res/res_ari.c
index 5145499be..7c12d3961 100644
--- a/res/res_ari.c
+++ b/res/res_ari.c
@@ -984,9 +984,11 @@ static int ast_ari_callback(struct ast_tcptls_session_instance *ser,
struct ast_str *buf = ast_str_create(512);
char *str = ast_json_dump_string_format(body, ast_ari_json_format());
- if (!buf) {
+ if (!buf || !str) {
ast_http_request_close_on_completion(ser);
ast_http_error(ser, 500, "Server Error", "Out of memory");
+ ast_json_free(str);
+ ast_free(buf);
goto request_failed;
}