mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
Fixing memory leak that would occur when reloading mod_xml_curl
This commit is contained in:
parent
4def48b881
commit
bcc2aa9899
@ -457,7 +457,7 @@ static switch_status_t do_config(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(binding = malloc(sizeof(*binding)))) {
|
||||
if (!(binding = switch_core_alloc(globals.pool, sizeof(*binding)))) {
|
||||
if (vars_map)
|
||||
switch_core_hash_destroy(&vars_map);
|
||||
goto done;
|
||||
@ -466,23 +466,23 @@ static switch_status_t do_config(void)
|
||||
|
||||
binding->auth_scheme = auth_scheme;
|
||||
binding->timeout = timeout;
|
||||
binding->url = strdup(url);
|
||||
binding->url = switch_core_strdup(globals.pool, url);
|
||||
switch_assert(binding->url);
|
||||
|
||||
if (bind_local != NULL) {
|
||||
binding->bind_local = strdup(bind_local);
|
||||
binding->bind_local = switch_core_strdup(globals.pool, bind_local);
|
||||
}
|
||||
if (method != NULL) {
|
||||
binding->method = strdup(method);
|
||||
binding->method = switch_core_strdup(globals.pool, method);
|
||||
} else {
|
||||
binding->method = NULL;
|
||||
}
|
||||
if (bind_mask) {
|
||||
binding->bindings = strdup(bind_mask);
|
||||
binding->bindings = switch_core_strdup(globals.pool, bind_mask);
|
||||
}
|
||||
|
||||
if (bind_cred) {
|
||||
binding->cred = strdup(bind_cred);
|
||||
binding->cred = switch_core_strdup(globals.pool, bind_cred);
|
||||
}
|
||||
|
||||
binding->disable100continue = disable100continue;
|
||||
@ -491,29 +491,29 @@ static switch_status_t do_config(void)
|
||||
binding->enable_cacert_check = enable_cacert_check;
|
||||
|
||||
if (ssl_cert_file) {
|
||||
binding->ssl_cert_file = strdup(ssl_cert_file);
|
||||
binding->ssl_cert_file = switch_core_strdup(globals.pool, ssl_cert_file);
|
||||
}
|
||||
|
||||
if (ssl_key_file) {
|
||||
binding->ssl_key_file = strdup(ssl_key_file);
|
||||
binding->ssl_key_file = switch_core_strdup(globals.pool, ssl_key_file);
|
||||
}
|
||||
|
||||
if (ssl_key_password) {
|
||||
binding->ssl_key_password = strdup(ssl_key_password);
|
||||
binding->ssl_key_password = switch_core_strdup(globals.pool, ssl_key_password);
|
||||
}
|
||||
|
||||
if (ssl_version) {
|
||||
binding->ssl_version = strdup(ssl_version);
|
||||
binding->ssl_version = switch_core_strdup(globals.pool, ssl_version);
|
||||
}
|
||||
|
||||
if (ssl_cacert_file) {
|
||||
binding->ssl_cacert_file = strdup(ssl_cacert_file);
|
||||
binding->ssl_cacert_file = switch_core_strdup(globals.pool, ssl_cacert_file);
|
||||
}
|
||||
|
||||
binding->enable_ssl_verifyhost = enable_ssl_verifyhost;
|
||||
|
||||
if (cookie_file) {
|
||||
binding->cookie_file = strdup(cookie_file);
|
||||
binding->cookie_file = switch_core_strdup(globals.pool, cookie_file);
|
||||
}
|
||||
|
||||
binding->vars_map = vars_map;
|
||||
|
Loading…
x
Reference in New Issue
Block a user