forked from Mirrors/freeswitch
Merge pull request #2026 from signalwire/coverity_06042023_mod_dialplan_asterisk
[mod_dialplan_asterisk] Coverity CID 1214207 (Resource leak)
This commit is contained in:
commit
f5bd2c653d
|
@ -142,6 +142,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
|
||||
if (!caller_profile || zstr(caller_profile->destination_number)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Obtaining Profile!\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -150,6 +151,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
if (!switch_config_open_file(&cfg, cf)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -226,12 +228,14 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
}
|
||||
} else {
|
||||
if (pattern && strcasecmp(pattern, field_data)) {
|
||||
switch_safe_free(field_expanded);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (cid) {
|
||||
if (strcasecmp(cid, caller_profile->caller_id_number)) {
|
||||
switch_safe_free(field_expanded);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -266,15 +270,19 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
switch_perform_substitution(re, proceed, argument, field_data, substituted, sizeof(substituted), ovector);
|
||||
argument = substituted;
|
||||
}
|
||||
|
||||
switch_regex_safe_free(re);
|
||||
|
||||
if (!extension) {
|
||||
if (zstr(field_data)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No extension!\n");
|
||||
switch_safe_free(field_expanded);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((extension = switch_caller_extension_new(session, field_data, field_data)) == 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
|
||||
switch_safe_free(field_expanded);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue