[Asterisk-code-review] manager: Fix appending variables. (asterisk[18])

N A asteriskteam at digium.com
Tue Jan 3 06:41:25 CST 2023


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19804 )


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/04/19804/1

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/+/19804
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I1b7f8b85a8918f6a814cb933a479d4278cf16199
Gerrit-Change-Number: 19804
Gerrit-PatchSet: 1
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230103/5f384bd8/attachment-0001.html>


More information about the asterisk-code-review mailing list