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

Joshua Colp asteriskteam at digium.com
Thu Oct 8 05:04:25 CDT 2020


Joshua Colp has submitted this change. ( 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.

ASTERISK-29108

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

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



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: 3
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201008/caa960b8/attachment-0001.html>


More information about the asterisk-code-review mailing list