Merge pull request #56 from lazedo/patch-1

[mod_kazoo] fix xml leak when event-filter is not available
This commit is contained in:
Andrey Volk 2019-10-13 20:29:34 +04:00 committed by GitHub
commit cec8f3b1ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -866,7 +866,8 @@ static void fetch_config_filters(switch_memory_pool_t *pool)
if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf);
} else if ((child = switch_xml_child(cfg, "event-filter"))) {
} else {
if ((child = switch_xml_child(cfg, "event-filter"))) {
switch_hash_t *filter;
switch_hash_t *old_filter;
@ -881,9 +882,10 @@ static void fetch_config_filters(switch_memory_pool_t *pool)
if (old_filter) {
switch_core_hash_destroy(&old_filter);
}
}
kazoo_globals.config_fetched = 1;
switch_xml_free(xml);
kazoo_globals.config_fetched = 1;
switch_xml_free(xml);
}
}