diff options
Diffstat (limited to 'res/res_ari.c')
-rw-r--r-- | res/res_ari.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_ari.c b/res/res_ari.c index 5145499be..9104eded3 100644 --- a/res/res_ari.c +++ b/res/res_ari.c @@ -73,6 +73,7 @@ /*** MODULEINFO <depend type="module">res_http_websocket</depend> + <depend type="module">res_stasis</depend> <support_level>core</support_level> ***/ @@ -984,9 +985,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; } |