diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/curses/gui-curses-color.c | 3 | ||||
-rw-r--r-- | src/gui/gui-bar-item-custom.c | 6 | ||||
-rw-r--r-- | src/gui/gui-bar.c | 9 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 6 | ||||
-rw-r--r-- | src/gui/gui-chat.c | 3 | ||||
-rw-r--r-- | src/gui/gui-color.c | 6 | ||||
-rw-r--r-- | src/gui/gui-completion.c | 3 | ||||
-rw-r--r-- | src/gui/gui-key.c | 6 |
8 files changed, 14 insertions, 28 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 7a8b0ebc9..1d1a857f1 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -1335,8 +1335,7 @@ gui_color_buffer_open () if (gui_color_buffer && !gui_color_buffer->short_name) gui_color_buffer->short_name = strdup (GUI_COLOR_BUFFER_NAME); - if (properties) - hashtable_free (properties); + hashtable_free (properties); } if (!gui_color_buffer) diff --git a/src/gui/gui-bar-item-custom.c b/src/gui/gui-bar-item-custom.c index 206eb96b5..70a6d91a7 100644 --- a/src/gui/gui-bar-item-custom.c +++ b/src/gui/gui-bar-item-custom.c @@ -333,10 +333,8 @@ gui_bar_item_custom_callback (const void *pointer, pointers, NULL, NULL); end: - if (pointers) - hashtable_free (pointers); - if (options) - hashtable_free (options); + hashtable_free (pointers); + hashtable_free (options); return result; } diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 37b943be9..456b8bdce 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -419,12 +419,9 @@ gui_bar_check_conditions (struct t_gui_bar *bar, rc = eval_is_true (result); free (result); - if (pointers) - hashtable_free (pointers); - if (extra_vars) - hashtable_free (extra_vars); - if (options) - hashtable_free (options); + hashtable_free (pointers); + hashtable_free (extra_vars); + hashtable_free (options); if (!rc) return 0; } diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 938c7c21c..14c0b910d 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1156,8 +1156,7 @@ gui_buffer_new_user (const char *name, enum t_gui_buffer_type buffer_type) &gui_buffer_user_input_cb, NULL, NULL, &gui_buffer_user_close_cb, NULL, NULL); - if (properties) - hashtable_free (properties); + hashtable_free (properties); return new_buffer; } @@ -3712,8 +3711,7 @@ gui_buffer_close (struct t_gui_buffer *buffer) gui_completion_free (buffer->completion); gui_nicklist_remove_all (buffer); gui_nicklist_remove_group (buffer, buffer->nicklist_root); - if (buffer->hotlist_max_level_nicks) - hashtable_free (buffer->hotlist_max_level_nicks); + hashtable_free (buffer->hotlist_max_level_nicks); gui_key_free_all (-1, &buffer->keys, &buffer->last_key, &buffer->keys_count, 0); gui_buffer_local_var_remove_all (buffer); diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index d69cc8df8..77b29c6d1 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -421,8 +421,7 @@ gui_chat_get_time_string (time_t date, int date_usec, int highlight) if (extra_vars) hashtable_set (extra_vars, "highlight", (highlight) ? "1" : "0"); text_with_color = eval_expression (text_time, NULL, extra_vars, NULL); - if (extra_vars) - hashtable_free (extra_vars); + hashtable_free (extra_vars); if (text_with_color) { if (strcmp (text_time, text_with_color) != 0) diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index a143dc5c8..1411f8a37 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -2013,10 +2013,8 @@ gui_color_palette_remove (int number) void gui_color_palette_free_structs () { - if (gui_color_hash_palette_color) - hashtable_free (gui_color_hash_palette_color); - if (gui_color_hash_palette_alias) - hashtable_free (gui_color_hash_palette_alias); + hashtable_free (gui_color_hash_palette_color); + hashtable_free (gui_color_hash_palette_alias); if (gui_color_list_with_alias) weelist_free (gui_color_list_with_alias); } diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index a4b0cc669..c2e775ffb 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -1428,8 +1428,7 @@ gui_completion_get_default_template (struct t_gui_completion *completion) NULL, NULL); hashtable_set (pointers, "buffer", completion->buffer); value = eval_expression (ptr_default_template, pointers, NULL, NULL); - if (pointers) - hashtable_free (pointers); + hashtable_free (pointers); return (value) ? value : strdup (""); } diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 2ef35bcea..10f2f378d 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -2250,10 +2250,8 @@ end: gui_focus_free_info (focus_info1); if (focus_info2) gui_focus_free_info (focus_info2); - if (hashtable_focus[0]) - hashtable_free (hashtable_focus[0]); - if (hashtable_focus[1]) - hashtable_free (hashtable_focus[1]); + hashtable_free (hashtable_focus[0]); + hashtable_free (hashtable_focus[1]); return rc; } |