From 75feed68fc829884dfd71585e2c43dbc79ac9f1f Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 26 Jun 2014 08:39:55 +0000 Subject: [PATCH] Avoid leaking memory on sofia profile reload We were leaking the string values of apply-candidate-acl parameters. --- src/mod/endpoints/mod_sofia/sofia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 2beff77a3d..0c04a796c0 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4909,7 +4909,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) } else if (!strcasecmp(var, "apply-candidate-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 { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", SWITCH_MAX_CAND_ACL); }