mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 08:49:01 +00:00
Avoid leaking memory on sofia profile reload
We were leaking the string values of apply-candidate-acl parameters.
This commit is contained in:
parent
63351a1061
commit
75feed68fc
@ -4909,7 +4909,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
|||||||
|
|
||||||
} else if (!strcasecmp(var, "apply-candidate-acl")) {
|
} else if (!strcasecmp(var, "apply-candidate-acl")) {
|
||||||
if (profile->cand_acl_count < SWITCH_MAX_CAND_ACL) {
|
if (profile->cand_acl_count < SWITCH_MAX_CAND_ACL) {
|
||||||
profile->cand_acl[profile->cand_acl_count++] = strdup(val);
|
profile->cand_acl[profile->cand_acl_count++] = switch_core_strdup(profile->pool, val);
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", SWITCH_MAX_CAND_ACL);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", SWITCH_MAX_CAND_ACL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user