|
@@ -2814,11 +2814,13 @@ SWITCH_DECLARE(int) switch_ivr_set_xml_call_stats(switch_xml_t xml, switch_core_
|
|
static int switch_ivr_set_xml_chan_var(switch_xml_t xml, const char *var, const char *val, int off)
|
|
static int switch_ivr_set_xml_chan_var(switch_xml_t xml, const char *var, const char *val, int off)
|
|
{
|
|
{
|
|
char *data;
|
|
char *data;
|
|
- switch_size_t dlen = strlen(val) * 3 + 1;
|
|
|
|
|
|
+ switch_size_t dlen;
|
|
switch_xml_t variable;
|
|
switch_xml_t variable;
|
|
|
|
|
|
if (!val) val = "";
|
|
if (!val) val = "";
|
|
|
|
|
|
|
|
+ dlen = strlen(val) * 3 + 1;
|
|
|
|
+
|
|
if (!zstr(var) && ((variable = switch_xml_add_child_d(xml, var, off++)))) {
|
|
if (!zstr(var) && ((variable = switch_xml_add_child_d(xml, var, off++)))) {
|
|
if ((data = malloc(dlen))) {
|
|
if ((data = malloc(dlen))) {
|
|
memset(data, 0, dlen);
|
|
memset(data, 0, dlen);
|