[Asterisk-code-review] manager: Fix appending variables. (asterisk[20])
George Joseph
asteriskteam at digium.com
Wed Jan 4 05:51:18 CST 2023
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19805 )
Change subject: manager: Fix appending variables.
......................................................................
manager: Fix appending variables.
The if statement here is always false after the for
loop finishes, so variables are never appended.
This removes that to properly append to the end
of the variable list.
ASTERISK-30351 #close
Reported by: Sebastian Gutierrez
Change-Id: I1b7f8b85a8918f6a814cb933a479d4278cf16199
---
M main/manager.c
1 file changed, 19 insertions(+), 4 deletions(-)
Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/main/manager.c b/main/manager.c
index 8a198b3..c5a48fd 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -6274,14 +6274,12 @@
old = vars;
vars = NULL;
- /* The variables in the AMI originate action are appended at the end of the list, to override any user variables that apply*/
+ /* The variables in the AMI originate action are appended at the end of the list, to override any user variables that apply */
vars = ast_variables_dup(s->session->chanvars);
if (old) {
for (v = vars; v->next; v = v->next );
- if (v->next) {
- v->next = old; /* Append originate variables at end of list */
- }
+ v->next = old; /* Append originate variables at end of list */
}
}
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19805
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 20
Gerrit-Change-Id: I1b7f8b85a8918f6a814cb933a479d4278cf16199
Gerrit-Change-Number: 19805
Gerrit-PatchSet: 2
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Friendly Automation
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/20230104/9a38c8d3/attachment-0001.html>
More information about the asterisk-code-review
mailing list