Fix various OMEMO memleaks
This commit is contained in:
@@ -1363,14 +1363,14 @@ omemo_automatic_start(const char *const recipient)
|
||||
} else if (g_list_find_custom(account->omemo_disabled, recipient, (GCompareFunc)g_strcmp0)) {
|
||||
result = FALSE;
|
||||
} else {
|
||||
return FALSE;
|
||||
result = FALSE;
|
||||
}
|
||||
break;
|
||||
case PROF_OMEMOPOLICY_ALWAYS:
|
||||
if (g_list_find_custom(account->omemo_disabled, recipient, (GCompareFunc)g_strcmp0)) {
|
||||
result = FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
result = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -38,10 +38,12 @@
|
||||
#include "omemo/omemo.h"
|
||||
#include "omemo/store.h"
|
||||
|
||||
static void _g_hash_table_free(GHashTable *hash_table);
|
||||
|
||||
GHashTable *
|
||||
session_store_new(void)
|
||||
{
|
||||
return g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL);
|
||||
return g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)_g_hash_table_free);
|
||||
}
|
||||
|
||||
GHashTable *
|
||||
@@ -441,3 +443,10 @@ load_sender_key(signal_buffer **record, signal_buffer **user_record,
|
||||
{
|
||||
return SG_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
_g_hash_table_free(GHashTable *hash_table)
|
||||
{
|
||||
g_hash_table_remove_all(hash_table);
|
||||
g_hash_table_unref(hash_table);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user