[Asterisk-code-review] res/res ari: Fix channels/{channelId}/dial memory leak (asterisk[master])
sungtae kim
asteriskteam at digium.com
Fri Nov 16 21:00:42 CST 2018
sungtae kim has uploaded this change for review. ( https://gerrit.asterisk.org/10668
Change subject: res/res_ari: Fix channels/{channelId}/dial memory leak
......................................................................
res/res_ari: Fix channels/{channelId}/dial memory leak
Changed to release the allocated memory after using it.
ASTERISK-28170
Change-Id: Ide532f2419a06e93cc676b2c94fe1af8b5d35269
---
M res/ari/resource_channels.c
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/68/10668/1
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c
index cdf0f88..b84da75 100644
--- a/res/ari/resource_channels.c
+++ b/res/ari/resource_channels.c
@@ -1869,6 +1869,7 @@
RAII_VAR(struct ast_channel *, caller, NULL, ast_channel_cleanup);
RAII_VAR(struct ast_channel *, callee, NULL, ast_channel_cleanup);
char *dialstring;
+ int ret;
control = find_control(response, args->channel_id);
if (control == NULL) {
@@ -1942,7 +1943,9 @@
ast_channel_stage_snapshot_done(callee);
ast_channel_unlock(callee);
- if (stasis_app_control_dial(control, dialstring, args->timeout)) {
+ ret = stasis_app_control_dial(control, dialstring, args->timeout);
+ ast_free(dialstring);
+ if (ret) {
ast_ari_response_alloc_failed(response);
return;
}
--
To view, visit https://gerrit.asterisk.org/10668
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide532f2419a06e93cc676b2c94fe1af8b5d35269
Gerrit-Change-Number: 10668
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181116/13cedeb7/attachment.html>
More information about the asterisk-code-review
mailing list