hi = switch_core_hash_find_rdlock(globals.translate_profiles, (const char *)profile, globals.profile_hash_rwlock);
if (!hi) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "can't find key for profile matching [%s]\n", profile);
+
return;
}
switch_regex_safe_free(re);
goto end;
}
+
memset(substituted, 0, len);
switch_perform_substitution(re, proceed, rule->replace, number, substituted, len, ovector);
} else if (event) {
subbed = switch_event_expand_headers(event, substituted);
}
+
+ if (subbed != substituted) {
+ switch_safe_free(substituted);
+ }
+
if (session) {
substituted = switch_core_session_strdup(session, subbed);
} else {
substituted = switch_core_strdup(pool, subbed);
}
- if (subbed != substituted) {
- switch_safe_free(subbed);
- }
+
+ switch_safe_free(subbed);
}
+ switch_regex_safe_free(re);
break;
}
}