]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Avoid leaking memory on sofia profile reload
authorTravis Cross <tc@traviscross.com>
Thu, 26 Jun 2014 08:39:55 +0000 (08:39 +0000)
committerTravis Cross <tc@traviscross.com>
Thu, 26 Jun 2014 08:39:55 +0000 (08:39 +0000)
We were leaking the string values of apply-candidate-acl parameters.

src/mod/endpoints/mod_sofia/sofia.c

index 2beff77a3d7ed4be9e6779641e8e22e4b44dbb72..0c04a796c02b4b3124aaeb2ff77ba11d3cce98e0 100644 (file)
@@ -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);
                                                }