From 75f791da8f28f575f9772180f3a31841814fe817 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 9 Feb 2015 21:53:55 +0000 Subject: Free hash table keys before modifying hash table --- src/ui/windows.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/windows.c b/src/ui/windows.c index 5ecada12..5993df19 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -408,9 +408,9 @@ wins_new_xmlconsole(void) { GList *keys = g_hash_table_get_keys(windows); int result = get_next_available_win_num(keys); + g_list_free(keys); ProfWin *newwin = win_create_xmlconsole(); g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin); - g_list_free(keys); return newwin; } @@ -419,9 +419,9 @@ wins_new_chat(const char * const barejid) { GList *keys = g_hash_table_get_keys(windows); int result = get_next_available_win_num(keys); + g_list_free(keys); ProfWin *newwin = win_create_chat(barejid); g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin); - g_list_free(keys); return newwin; } @@ -430,9 +430,9 @@ wins_new_muc(const char * const roomjid) { GList *keys = g_hash_table_get_keys(windows); int result = get_next_available_win_num(keys); + g_list_free(keys); ProfWin *newwin = win_create_muc(roomjid); g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin); - g_list_free(keys); return newwin; } @@ -441,9 +441,9 @@ wins_new_muc_config(const char * const roomjid, DataForm *form) { GList *keys = g_hash_table_get_keys(windows); int result = get_next_available_win_num(keys); + g_list_free(keys); ProfWin *newwin = win_create_muc_config(roomjid, form); g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin); - g_list_free(keys); return newwin; } @@ -452,9 +452,9 @@ wins_new_private(const char * const fulljid) { GList *keys = g_hash_table_get_keys(windows); int result = get_next_available_win_num(keys); + g_list_free(keys); ProfWin *newwin = win_create_private(fulljid); g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin); - g_list_free(keys); return newwin; } -- cgit 1.4.1-2-gfad0