[Asterisk-code-review] resource_endpoints.c: memory leak when providing a 404 response (asterisk[master])

Jean Aunis - Prescom asteriskteam at digium.com
Mon Oct 5 10:51:58 CDT 2020


Jean Aunis - Prescom has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15039 )


Change subject: resource_endpoints.c: memory leak when providing a 404 response
......................................................................

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.

Change-Id: Ie1d3d70065f80793445b60f5e4a7eb31b4b9c5c8
---
M res/ari/resource_endpoints.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/39/15039/1

diff --git a/res/ari/resource_endpoints.c b/res/ari/resource_endpoints.c
index e0bbcb5..4613282 100644
--- a/res/ari/resource_endpoints.c
+++ b/res/ari/resource_endpoints.c
@@ -211,6 +211,7 @@
 	if (ast_msg_send(msg, to, from)) {
 		ast_ari_response_error(response, 404, "Not Found",
 			"Endpoint not found");
+		return;
 	}
 
 	response->message = ast_json_null();

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15039
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie1d3d70065f80793445b60f5e4a7eb31b4b9c5c8
Gerrit-Change-Number: 15039
Gerrit-PatchSet: 1
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201005/e793eb30/attachment.html>


More information about the asterisk-code-review mailing list