resource_endpoints.c: memory leak when providing a 404 response

When handling a send_message request to a non-existing endpoint, the response's
body is overriden and not properly freed.

ASTERISK-29108

Change-Id: Ie1d3d70065f80793445b60f5e4a7eb31b4b9c5c8
This commit is contained in:
Jean Aunis 2020-10-05 17:44:04 +02:00 committed by Jean Aunis - Prescom
parent abee490639
commit 7ced144867
1 changed files with 1 additions and 0 deletions

View File

@ -211,6 +211,7 @@ static void send_message(const char *to, const char *from, const char *body, str
if (ast_msg_send(msg, to, from)) {
ast_ari_response_error(response, 404, "Not Found",
"Endpoint not found");
return;
}
response->message = ast_json_null();