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

@@ -66,9 +66,19 @@ static int _bookmark_result_id_handler(xmpp_stanza_t* const stanza, void* const
static void _bookmark_destroy(Bookmark* bookmark);
static void _send_bookmarks(void);
static void
_bookmark_shutdown(void)
{
if (bookmarks) {
g_hash_table_destroy(bookmarks);
}
autocomplete_free(bookmark_ac);
}
void
bookmark_request(void)
{
prof_add_shutdown_routine(_bookmark_shutdown);
if (bookmarks) {
g_hash_table_destroy(bookmarks);
}