From d4afcd3258c2d6641ae4323c649fc8ebf007e69a Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 20:37:03 +0100 Subject: [PATCH 01/14] Fixed memleak when leaving rooms --- src/muc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/muc.c b/src/muc.c index 3cf1f506..22fd5256 100644 --- a/src/muc.c +++ b/src/muc.c @@ -584,10 +584,10 @@ _free_room(ChatRoom *room) if (room->nick_changes != NULL) { g_hash_table_remove_all(room->nick_changes); } - free(room); if (room->pending_broadcasts != NULL) { g_list_free_full(room->pending_broadcasts, free); } + free(room); } } From 4d0566b5d18dbb35d343633f94dd6ee255fd01d7 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 20:39:50 +0100 Subject: [PATCH 02/14] Fixed memleak in _available_handler --- src/xmpp/presence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 5120e231..d6a2c7f2 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -545,6 +545,7 @@ _available_handler(xmpp_conn_t * const conn, if (priority_str != NULL) { priority = atoi(priority_str); } + free(priority_str); } resource_presence_t presence = resource_presence_from_string(show_str); From ccf5cb846ba13d6b9356a0ce01576e9f95103a23 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 20:46:12 +0100 Subject: [PATCH 03/14] Added connection details to jabber_shutdown --- src/xmpp/connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index e32ba4ed..5a97a525 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -199,6 +199,9 @@ _jabber_disconnect(void) static void _jabber_shutdown(void) { + _connection_free_saved_account(); + _connection_free_saved_details(); + _connection_free_session_data(); xmpp_shutdown(); } From d181f500ea2548bf6f69a0fb396293c5a4fa6d3b Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 20:56:24 +0100 Subject: [PATCH 04/14] Fixed usages of get_unique_id to free result --- src/xmpp/bookmark.c | 3 ++- src/xmpp/presence.c | 3 +++ src/xmpp/stanza.c | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 01e86451..1a7196a1 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -403,6 +403,7 @@ _send_bookmarks(void) xmpp_stanza_set_name(iq, STANZA_NAME_IQ); char *id = generate_unique_id("bookmarks_update"); xmpp_stanza_set_id(iq, id); + free(id); xmpp_stanza_set_type(iq, STANZA_TYPE_SET); xmpp_stanza_t *query = xmpp_stanza_new(ctx); @@ -479,4 +480,4 @@ bookmark_init_module(void) bookmark_get_list = _bookmark_get_list; bookmark_find = _bookmark_find; bookmark_autocomplete_reset = _bookmark_autocomplete_reset; -} \ No newline at end of file +} diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index d6a2c7f2..a1cb0ab9 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -125,6 +125,7 @@ _presence_subscription(const char * const jid, const jabber_subscr_t action) xmpp_stanza_release(presence); jid_destroy(jidp); + free(id); } static GSList * @@ -224,6 +225,7 @@ _presence_update(const resource_presence_t presence_type, const char * const msg last = STANZA_TEXT_ONLINE; } accounts_set_last_presence(jabber_get_account_name(), last); + free(id); } static void @@ -626,6 +628,7 @@ _get_caps_key(xmpp_stanza_t * const stanza) id = generate_unique_id("caps"); _send_caps_request(node, caps_key, id, from); + free(id); // unsupported hash or legacy capabilities } else { diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 6006fdb4..3f0b5015 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -198,6 +198,7 @@ stanza_create_chat_state(xmpp_ctx_t *ctx, const char * const recipient, xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient); char *id = generate_unique_id(NULL); xmpp_stanza_set_id(msg, id); + free(id); chat_state = xmpp_stanza_new(ctx); xmpp_stanza_set_name(chat_state, state); @@ -221,6 +222,7 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient, xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient); char *id = generate_unique_id(NULL); xmpp_stanza_set_id(msg, id); + free(id); body = xmpp_stanza_new(ctx); xmpp_stanza_set_name(body, STANZA_NAME_BODY); @@ -324,6 +326,7 @@ stanza_create_invite(xmpp_ctx_t *ctx, const char * const room, xmpp_stanza_set_attribute(message, STANZA_ATTR_TO, contact); char *id = generate_unique_id(NULL); xmpp_stanza_set_id(message, id); + free(id); x = xmpp_stanza_new(ctx); xmpp_stanza_set_name(x, STANZA_NAME_X); @@ -349,6 +352,7 @@ stanza_create_room_join_presence(xmpp_ctx_t * const ctx, xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_room_jid); char *id = generate_unique_id("join"); xmpp_stanza_set_id(presence, id); + free(id); xmpp_stanza_t *x = xmpp_stanza_new(ctx); xmpp_stanza_set_name(x, STANZA_NAME_X); @@ -379,6 +383,7 @@ stanza_create_room_newnick_presence(xmpp_ctx_t *ctx, xmpp_stanza_t *presence = xmpp_stanza_new(ctx); char *id = generate_unique_id("sub"); xmpp_stanza_set_id(presence, id); + free(id); xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE); xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_room_jid); @@ -399,6 +404,7 @@ stanza_create_room_leave_presence(xmpp_ctx_t *ctx, const char * const room, xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_jid->str); char *id = generate_unique_id("leave"); xmpp_stanza_set_id(presence, id); + free(id); g_string_free(full_jid, TRUE); @@ -512,6 +518,7 @@ stanza_create_ping_iq(xmpp_ctx_t *ctx) xmpp_stanza_set_type(iq, STANZA_TYPE_GET); char *id = generate_unique_id("ping"); xmpp_stanza_set_id(iq, id); + free(id); xmpp_stanza_t *ping = xmpp_stanza_new(ctx); xmpp_stanza_set_name(ping, STANZA_NAME_PING); From d6d714e1ed3817ab7540dcb2c794e652b74846c7 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:00:01 +0100 Subject: [PATCH 05/14] Free saved account details before replacing --- src/xmpp/connection.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 5a97a525..a7cdbc1a 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -117,7 +117,13 @@ _jabber_connect_with_account(const ProfAccount * const account) log_info("Connecting using account: %s", account->name); // save account name and password for reconnect + if (saved_account.name != NULL) { + free(saved_account.name); + } saved_account.name = strdup(account->name); + if (saved_account.passwd != NULL) { + free(saved_account.passwd); + } saved_account.passwd = strdup(account->password); // connect with fulljid From bc03e0dc02585733b3296b8c089030d4de84a1ee Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:04:07 +0100 Subject: [PATCH 06/14] Free list in wins_get_by_recipient --- src/ui/windows.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/windows.c b/src/ui/windows.c index 2988ba6e..6f9a6a8e 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -159,6 +159,7 @@ wins_get_by_recipient(const char * const recipient) curr = g_list_next(curr); } + g_list_free(values); return NULL; } From c9274a38b29fe07d635b07d7c8bb8652fc2cf6f3 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:19:53 +0100 Subject: [PATCH 07/14] Free jabber_conn.log --- src/xmpp/connection.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index a7cdbc1a..660fe913 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -209,6 +209,7 @@ _jabber_shutdown(void) _connection_free_saved_details(); _connection_free_session_data(); xmpp_shutdown(); + free(jabber_conn.log); } static void @@ -358,6 +359,9 @@ _jabber_connect(const char * const fulljid, const char * const passwd, jid_destroy(jid); log_info("Connecting as %s", fulljid); + if (jabber_conn.log != NULL) { + free(jabber_conn.log); + } jabber_conn.log = _xmpp_get_file_logger(); if (jabber_conn.conn != NULL) { From 258a0ec8734de09f2ef3fcd612d14b8af9811914 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:23:21 +0100 Subject: [PATCH 08/14] Fix memleak in wins_new --- src/ui/windows.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/windows.c b/src/ui/windows.c index 6f9a6a8e..c2edb9e1 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -239,6 +239,7 @@ wins_new(const char * const from, win_type_t type) int cols = getmaxx(stdscr); ProfWin *new = win_create(from, cols, type); g_hash_table_insert(windows, GINT_TO_POINTER(result), new); + g_list_free(keys); return new; } From 2c4e2d5dbd48dd06a2aa0ebd6fae59c0c2a2c337 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:33:29 +0100 Subject: [PATCH 09/14] Fixed memleak in otr.c --- src/otr/otr.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/otr/otr.c b/src/otr/otr.c index e13e2d3e..501c7583 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -104,10 +104,12 @@ static void cb_write_fingerprints(void *opdata) { gcry_error_t err = 0; - gchar *data_home = xdg_get_data_home(); - gchar *account_dir = str_replace(jid, "@", "_at_"); + gchar *data_home = xdg_get_data_home(); GString *basedir = g_string_new(data_home); + free(data_home); + + gchar *account_dir = str_replace(jid, "@", "_at_"); g_string_append(basedir, "/profanity/otr/"); g_string_append(basedir, account_dir); g_string_append(basedir, "/"); @@ -174,9 +176,10 @@ _otr_on_connect(ProfAccount *account) log_info("Loading OTR key for %s", jid); gchar *data_home = xdg_get_data_home(); - gchar *account_dir = str_replace(jid, "@", "_at_"); - GString *basedir = g_string_new(data_home); + free(data_home); + + gchar *account_dir = str_replace(jid, "@", "_at_"); g_string_append(basedir, "/profanity/otr/"); g_string_append(basedir, account_dir); g_string_append(basedir, "/"); @@ -256,9 +259,10 @@ _otr_keygen(ProfAccount *account) jid = strdup(account->jid); gchar *data_home = xdg_get_data_home(); - gchar *account_dir = str_replace(jid, "@", "_at_"); - GString *basedir = g_string_new(data_home); + free(data_home); + + gchar *account_dir = str_replace(jid, "@", "_at_"); g_string_append(basedir, "/profanity/otr/"); g_string_append(basedir, account_dir); g_string_append(basedir, "/"); From d89ac912eb379f571ec37e59aea7e1e1d4b39ed5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:36:47 +0100 Subject: [PATCH 10/14] Free list in wins_get_num --- src/ui/windows.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/windows.c b/src/ui/windows.c index c2edb9e1..c3c44795 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -154,6 +154,7 @@ wins_get_by_recipient(const char * const recipient) while (curr != NULL) { ProfWin *window = curr->data; if (g_strcmp0(window->from, recipient) == 0) { + g_list_free(values); return window; } curr = g_list_next(curr); @@ -173,11 +174,13 @@ wins_get_num(ProfWin *window) gconstpointer num_p = curr->data; ProfWin *curr_win = g_hash_table_lookup(windows, num_p); if (g_strcmp0(curr_win->from, window->from) == 0) { + g_list_free(keys); return GPOINTER_TO_INT(num_p); } curr = g_list_next(curr); } + g_list_free(keys); return -1; } From efc833a20272eec3ffea2bfefc1805803857daa1 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:39:54 +0100 Subject: [PATCH 11/14] Free string after use in sending caps response --- src/xmpp/capabilities.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index 5f2ad422..033b46df 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -238,6 +238,7 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx) #endif } xmpp_stanza_set_attribute(identity, "name", name_str->str); + g_string_free(name_str, TRUE); xmpp_stanza_t *feature_caps = xmpp_stanza_new(ctx); xmpp_stanza_set_name(feature_caps, STANZA_NAME_FEATURE); From 1c62d7fda8d644b3f8c6bceefc99d1730026a057 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 21:49:34 +0100 Subject: [PATCH 12/14] Renamed generate_unique_id -> create_unique_id --- src/common.c | 2 +- src/common.h | 2 +- src/xmpp/bookmark.c | 2 +- src/xmpp/presence.c | 6 +++--- src/xmpp/roster.c | 4 ++-- src/xmpp/stanza.c | 16 ++++++++-------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/common.c b/src/common.c index d52c388e..9ca152d3 100644 --- a/src/common.c +++ b/src/common.c @@ -397,7 +397,7 @@ xdg_get_data_home(void) } char * -generate_unique_id(char *prefix) +create_unique_id(char *prefix) { static unsigned long unique_id; char *result = NULL; diff --git a/src/common.h b/src/common.h index 7b98a2bc..5521d310 100644 --- a/src/common.h +++ b/src/common.h @@ -99,7 +99,7 @@ resource_presence_t resource_presence_from_string(const char * const str); contact_presence_t contact_presence_from_resource_presence(resource_presence_t resource_presence); char * p_sha1_hash(char *str); -char * generate_unique_id(char *prefix); +char * create_unique_id(char *prefix); int cmp_win_num(gconstpointer a, gconstpointer b); int get_next_available_win_num(GList *used); diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 1a7196a1..083a5f54 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -401,7 +401,7 @@ _send_bookmarks(void) xmpp_stanza_t *iq = xmpp_stanza_new(ctx); xmpp_stanza_set_name(iq, STANZA_NAME_IQ); - char *id = generate_unique_id("bookmarks_update"); + char *id = create_unique_id("bookmarks_update"); xmpp_stanza_set_id(iq, id); free(id); xmpp_stanza_set_type(iq, STANZA_TYPE_SET); diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index a1cb0ab9..4585cc51 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -116,7 +116,7 @@ _presence_subscription(const char * const jid, const jabber_subscr_t action) } xmpp_stanza_t *presence = xmpp_stanza_new(ctx); - char *id = generate_unique_id("sub"); + char *id = create_unique_id("sub"); xmpp_stanza_set_id(presence, id); xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE); xmpp_stanza_set_type(presence, type); @@ -208,7 +208,7 @@ _presence_update(const resource_presence_t presence_type, const char * const msg connection_set_priority(pri); xmpp_stanza_t *presence = stanza_create_presence(ctx); - char *id = generate_unique_id("presence"); + char *id = create_unique_id("presence"); xmpp_stanza_set_id(presence, id); stanza_attach_show(ctx, presence, show); stanza_attach_status(ctx, presence, msg); @@ -625,7 +625,7 @@ _get_caps_key(xmpp_stanza_t * const stanza) if ((hash_type != NULL) && (strcmp(hash_type, "sha-1") == 0)) { log_debug("Hash type %s supported.", hash_type); caps_key = strdup(node); - id = generate_unique_id("caps"); + id = create_unique_id("caps"); _send_caps_request(node, caps_key, id, from); free(id); diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c index e0c19971..2e566659 100644 --- a/src/xmpp/roster.c +++ b/src/xmpp/roster.c @@ -126,7 +126,7 @@ _roster_send_add_to_group(const char * const group, PContact contact) new_groups = g_slist_append(new_groups, strdup(group)); // add an id handler to handle the response - char *unique_id = generate_unique_id(NULL); + char *unique_id = create_unique_id(NULL); GroupData *data = malloc(sizeof(GroupData)); data->group = strdup(group); if (p_contact_name(contact) != NULL) { @@ -175,7 +175,7 @@ _roster_send_remove_from_group(const char * const group, PContact contact) xmpp_ctx_t * const ctx = connection_get_ctx(); // add an id handler to handle the response - char *unique_id = generate_unique_id(NULL); + char *unique_id = create_unique_id(NULL); GroupData *data = malloc(sizeof(GroupData)); data->group = strdup(group); if (p_contact_name(contact) != NULL) { diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 3f0b5015..5364e579 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -100,7 +100,7 @@ stanza_create_bookmarks_pubsub_add(xmpp_ctx_t *ctx, const char * const jid, { xmpp_stanza_t *stanza = xmpp_stanza_new(ctx); xmpp_stanza_set_name(stanza, STANZA_NAME_IQ); - char *id = generate_unique_id("bookmark_add"); + char *id = create_unique_id("bookmark_add"); xmpp_stanza_set_id(stanza, id); xmpp_stanza_set_type(stanza, STANZA_TYPE_SET); @@ -196,7 +196,7 @@ stanza_create_chat_state(xmpp_ctx_t *ctx, const char * const recipient, xmpp_stanza_set_name(msg, STANZA_NAME_MESSAGE); xmpp_stanza_set_type(msg, STANZA_TYPE_CHAT); xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient); - char *id = generate_unique_id(NULL); + char *id = create_unique_id(NULL); xmpp_stanza_set_id(msg, id); free(id); @@ -220,7 +220,7 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient, xmpp_stanza_set_name(msg, STANZA_NAME_MESSAGE); xmpp_stanza_set_type(msg, type); xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient); - char *id = generate_unique_id(NULL); + char *id = create_unique_id(NULL); xmpp_stanza_set_id(msg, id); free(id); @@ -324,7 +324,7 @@ stanza_create_invite(xmpp_ctx_t *ctx, const char * const room, message = xmpp_stanza_new(ctx); xmpp_stanza_set_name(message, STANZA_NAME_MESSAGE); xmpp_stanza_set_attribute(message, STANZA_ATTR_TO, contact); - char *id = generate_unique_id(NULL); + char *id = create_unique_id(NULL); xmpp_stanza_set_id(message, id); free(id); @@ -350,7 +350,7 @@ stanza_create_room_join_presence(xmpp_ctx_t * const ctx, xmpp_stanza_t *presence = xmpp_stanza_new(ctx); xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE); xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_room_jid); - char *id = generate_unique_id("join"); + char *id = create_unique_id("join"); xmpp_stanza_set_id(presence, id); free(id); @@ -381,7 +381,7 @@ stanza_create_room_newnick_presence(xmpp_ctx_t *ctx, const char * const full_room_jid) { xmpp_stanza_t *presence = xmpp_stanza_new(ctx); - char *id = generate_unique_id("sub"); + char *id = create_unique_id("sub"); xmpp_stanza_set_id(presence, id); free(id); xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE); @@ -402,7 +402,7 @@ stanza_create_room_leave_presence(xmpp_ctx_t *ctx, const char * const room, xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE); xmpp_stanza_set_type(presence, STANZA_TYPE_UNAVAILABLE); xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_jid->str); - char *id = generate_unique_id("leave"); + char *id = create_unique_id("leave"); xmpp_stanza_set_id(presence, id); free(id); @@ -516,7 +516,7 @@ stanza_create_ping_iq(xmpp_ctx_t *ctx) xmpp_stanza_t *iq = xmpp_stanza_new(ctx); xmpp_stanza_set_name(iq, STANZA_NAME_IQ); xmpp_stanza_set_type(iq, STANZA_TYPE_GET); - char *id = generate_unique_id("ping"); + char *id = create_unique_id("ping"); xmpp_stanza_set_id(iq, id); free(id); From 6483bc8d7ce037497594c0d4f83b237b27a94cb8 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 22:26:28 +0100 Subject: [PATCH 13/14] Removed string allocation in stanza when joining room --- src/xmpp/stanza.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 5364e579..8d5d85f2 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -363,7 +363,7 @@ stanza_create_room_join_presence(xmpp_ctx_t * const ctx, xmpp_stanza_t *pass = xmpp_stanza_new(ctx); xmpp_stanza_set_name(pass, "password"); xmpp_stanza_t *text = xmpp_stanza_new(ctx); - xmpp_stanza_set_text(text, strdup(passwd)); + xmpp_stanza_set_text(text, passwd); xmpp_stanza_add_child(pass, text); xmpp_stanza_add_child(x, pass); xmpp_stanza_release(text); From 235c893f285103dd0925192ae12b69786647c165 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 22:39:46 +0100 Subject: [PATCH 14/14] Properly free muc hashtables --- src/muc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/muc.c b/src/muc.c index 22fd5256..64ca9bca 100644 --- a/src/muc.c +++ b/src/muc.c @@ -576,13 +576,13 @@ _free_room(ChatRoom *room) free(room->subject); free(room->password); if (room->roster != NULL) { - g_hash_table_remove_all(room->roster); + g_hash_table_destroy(room->roster); } if (room->nick_ac != NULL) { autocomplete_free(room->nick_ac); } if (room->nick_changes != NULL) { - g_hash_table_remove_all(room->nick_changes); + g_hash_table_destroy(room->nick_changes); } if (room->pending_broadcasts != NULL) { g_list_free_full(room->pending_broadcasts, free);