From: Guido Falsi Date: Thu, 18 Jun 2020 10:14:26 +0000 (+0200) Subject: chan_dadhi: Fix setvar in dahdi channels X-Git-Tag: 16.12.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10bc2d40e50402c5a3663e635a6908df0f111b7d;p=thirdparty%2Fasterisk.git chan_dadhi: Fix setvar in dahdi channels The change to how setvar works for various channels performed in ASTERISK~23756 missed some required change in the dahdi channel, where the variables are actually set while reading configuration. This change should fix the issue. ASTERISK-28955 Change-Id: Ibfeb7f8cbdd735346dc4028de6a265f24f9df274 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index a4e564d1a6..39aea8f40c 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -18147,8 +18147,10 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct if ((varval = strchr(varname, '='))) { *varval++ = '\0'; if ((tmpvar = ast_variable_new(varname, varval, ""))) { - tmpvar->next = confp->chan.vars; - confp->chan.vars = tmpvar; + if (ast_variable_list_replace(&confp->chan.vars, tmpvar)) { + tmpvar->next = confp->chan.vars; + confp->chan.vars = tmpvar; + } } } }