1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-07-07 18:04:15 -04:00

Fix memory leaks

This commit is contained in:
James Booth 2016-06-08 22:23:00 +01:00
parent 4c03ee6066
commit d79364358a
3 changed files with 8 additions and 21 deletions

View File

@ -6,25 +6,6 @@
...
}
# libotr
{
otrl_init
Memcheck:Leak
...
fun:otrl_init
...
}
{
otrl_privkey_read
Memcheck:Leak
...
fun:otrl_privkey_read_FILEp
fun:otrl_privkey_read
...
}
# glib
{

View File

@ -74,8 +74,11 @@ _chat_session_free(ChatSession *session)
void
chat_sessions_init(void)
{
sessions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
(GDestroyNotify)_chat_session_free);
if (sessions) {
g_hash_table_destroy(sessions);
}
sessions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)_chat_session_free);
}
void

View File

@ -231,6 +231,9 @@ otr_on_connect(ProfAccount *account)
return;
}
if (user_state) {
otrl_userstate_free(user_state);
}
user_state = otrl_userstate_create();
gcry_error_t err = 0;