mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-12 20:27:19 +00:00
don't leak db connections (ok, only 1)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15684 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
5828d178de
commit
ca55ba252f
@ -610,6 +610,7 @@ static vm_profile_t * load_profile(const char *profile_name)
|
|||||||
vm_profile_t *profile = NULL;
|
vm_profile_t *profile = NULL;
|
||||||
switch_xml_t x_profiles, x_profile, cfg, xml, x_email, param;
|
switch_xml_t x_profiles, x_profile, cfg, xml, x_email, param;
|
||||||
switch_event_t *event = NULL;
|
switch_event_t *event = NULL;
|
||||||
|
switch_cache_db_handle_t *dbh;
|
||||||
|
|
||||||
if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) {
|
if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf);
|
||||||
@ -621,7 +622,6 @@ static vm_profile_t * load_profile(const char *profile_name)
|
|||||||
|
|
||||||
if ((x_profile = switch_xml_find_child(x_profiles, "profile", "name", profile_name))) {
|
if ((x_profile = switch_xml_find_child(x_profiles, "profile", "name", profile_name))) {
|
||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
switch_cache_db_handle_t *dbh;
|
|
||||||
int x, count;
|
int x, count;
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
|
|
||||||
@ -707,6 +707,7 @@ static vm_profile_t * load_profile(const char *profile_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
switch_cache_db_release_db_handle(&dbh);
|
||||||
if (xml) {
|
if (xml) {
|
||||||
switch_xml_free(xml);
|
switch_xml_free(xml);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user