diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 7bfe0186f6..0c0a444b2b 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -2814,7 +2814,7 @@ 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) { char *data; - switch_size_t dlen = strlen(val) * 3 + 1; + switch_size_t dlen = val ? strlen(val) * 3 + 1 : 1; switch_xml_t variable; if (!val) val = "";