switch_regex_safe_free(re);
switch_safe_free(field_expanded);
+ if (expression == expression_expanded) expression = NULL;
switch_safe_free(expression_expanded);
}
}
switch_safe_free(field_expanded);
+ if (expression == expression_expanded) expression = NULL;
switch_safe_free(expression_expanded);
} else {
if ((xexpression = switch_xml_child(xcond, "expression"))) {
proceed = 1;
}
} else {
- if (field && strchr(expression, '(')) {
+ if (field && expression && strchr(expression, '(')) {
switch_channel_set_variable(channel, "DP_MATCH", NULL);
switch_capture_regex(re, proceed, field_data, ovector, "DP_MATCH", switch_regex_set_var_callback, session);
}
data = (char *) switch_xml_attr_soft(xaction, "data");
}
- if (field && strchr(expression, '(')) {
+ if (field && expression && strchr(expression, '(')) {
len = (uint32_t) (strlen(data) + strlen(field_data) + 10) * proceed;
if (!(substituted = malloc(len))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Memory Error!\n");