Fix some more memory leaks + an invalid read.

`ProfMessage` was not completely initialized, fix this by using `calloc()`
for the allocation.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel
2025-03-07 11:49:08 +01:00
parent 93fc4ecd8b
commit b55bf6e4bd
6 changed files with 24 additions and 11 deletions

View File

@@ -57,9 +57,19 @@ static int _block_remove_result_handler(xmpp_stanza_t* const stanza, void* const
static GList* blocked;
static Autocomplete blocked_ac;
static void
_blocking_shutdown(void)
{
if (blocked) {
g_list_free_full(blocked, free);
}
autocomplete_free(blocked_ac);
}
void
blocking_request(void)
{
prof_add_shutdown_routine(_blocking_shutdown);
if (blocked) {
g_list_free_full(blocked, free);
blocked = NULL;