[mod_mongo, mod_redis, mod_voicemail] Fix leaking hash iterators.

This commit is contained in:
Andrey Volk 2020-11-19 21:18:09 +04:00
parent 9608a56873
commit 90c35685c3
3 changed files with 4 additions and 0 deletions

View File

@ -698,6 +698,7 @@ SWITCH_LIMIT_RELEASE(mod_mongo_limit_release)
if (mod_mongo_increment(session, (const char *)p_key, -1, 0, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Couldn't decrement %s\n", (const char *)p_key);
status = SWITCH_STATUS_FALSE;
free(hi);
break;
} else {
switch_core_hash_delete(pvt->resources, (const char *) p_key);

View File

@ -197,11 +197,13 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
if (credis_decr(redis, (const char*)p_key, &val) != 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", (char *)p_key);
free(hi);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_switchname(), (char *)p_key);
if (credis_decr(redis,p_uuid_key,&uuid_val) != 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", p_uuid_key);
free(hi);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
switch_core_hash_delete(pvt->hash, (const char *) p_key);

View File

@ -3855,6 +3855,7 @@ SWITCH_STANDARD_API(boxcount_api_function)
total_new_messages = total_saved_messages = 0;
message_count(profile, id, domain, "inbox", &total_new_messages, &total_saved_messages,
&total_new_urgent_messages, &total_saved_urgent_messages);
free(hi);
}
switch_mutex_unlock(globals.mutex);
}