[Asterisk-code-review] ari: Destroy body variables in channel create. (asterisk[20])
George Joseph
asteriskteam at digium.com
Fri Dec 9 06:48:59 CST 2022
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19670 )
Change subject: ari: Destroy body variables in channel create.
......................................................................
ari: Destroy body variables in channel create.
When passing a JSON body to the 'create' channel route
it would be converted into Asterisk variables, but never
freed resulting in a memory leak.
This change makes it so that the variables are freed in
all cases.
ASTERISK-30344
Change-Id: I924dbd866a01c6073e2d6fb846ccaa27ef72d49d
---
M res/ari/resource_channels.c
1 file changed, 19 insertions(+), 1 deletion(-)
Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c
index 71c4a14..9ee4a46 100644
--- a/res/ari/resource_channels.c
+++ b/res/ari/resource_channels.c
@@ -1779,7 +1779,7 @@
struct ast_ari_channels_create_args *args,
struct ast_ari_response *response)
{
- struct ast_variable *variables = NULL;
+ RAII_VAR(struct ast_variable *, variables, NULL, ast_variables_destroy);
struct ast_assigned_ids assignedids;
struct ari_channel_thread_data *chan_data;
struct ast_channel_snapshot *snapshot;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19670
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 20
Gerrit-Change-Id: I924dbd866a01c6073e2d6fb846ccaa27ef72d49d
Gerrit-Change-Number: 19670
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221209/3d4052b4/attachment-0001.html>
More information about the asterisk-code-review
mailing list