mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Stasis/ARI: Fix off-nominal path json memory leaks.
Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user