From: Jean Aunis Date: Mon, 5 Oct 2020 15:44:04 +0000 (+0200) Subject: resource_endpoints.c: memory leak when providing a 404 response X-Git-Tag: 17.9.0-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b11f1242c5b3f36a27e35e40771d3f4ed5ab24d3;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/ari/resource_endpoints.c b/res/ari/resource_endpoints.c index e0bbcb5336..461328277a 100644 --- a/res/ari/resource_endpoints.c +++ b/res/ari/resource_endpoints.c @@ -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();