summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core-command.c6
-rw-r--r--src/core/core-completion.c3
-rw-r--r--src/core/core-eval.c3
-rw-r--r--src/core/core-hdata.c6
-rw-r--r--src/core/core-network.c3
-rw-r--r--src/core/core-secure-buffer.c3
-rw-r--r--src/core/hook/hook-line.c3
-rw-r--r--src/gui/curses/gui-curses-color.c3
-rw-r--r--src/gui/gui-bar-item-custom.c6
-rw-r--r--src/gui/gui-bar.c9
-rw-r--r--src/gui/gui-buffer.c6
-rw-r--r--src/gui/gui-chat.c3
-rw-r--r--src/gui/gui-color.c6
-rw-r--r--src/gui/gui-completion.c3
-rw-r--r--src/gui/gui-key.c6
15 files changed, 23 insertions, 46 deletions
diff --git a/src/core/core-command.c b/src/core/core-command.c
index 1bcbe1cb6..552040a2d 100644
--- a/src/core/core-command.c
+++ b/src/core/core-command.c
@@ -2485,10 +2485,8 @@ COMMAND_CALLBACK(eval)
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
}
- if (pointers)
- hashtable_free (pointers);
- if (options)
- hashtable_free (options);
+ hashtable_free (pointers);
+ hashtable_free (options);
}
return WEECHAT_RC_OK;
diff --git a/src/core/core-completion.c b/src/core/core-completion.c
index 1f00ecdee..21cb25e60 100644
--- a/src/core/core-completion.c
+++ b/src/core/core-completion.c
@@ -1317,8 +1317,7 @@ completion_list_add_plugins_installed_cb (const void *pointer, void *data,
hashtable_set (options, "directory", "data");
plugin_path = string_eval_path_home (CONFIG_STRING(config_plugin_path),
NULL, NULL, options);
- if (options)
- hashtable_free (options);
+ hashtable_free (options);
if (plugin_path)
{
dir_exec_on_files (plugin_path, 1, 0,
diff --git a/src/core/core-eval.c b/src/core/core-eval.c
index 815273aaa..dff54a089 100644
--- a/src/core/core-eval.c
+++ b/src/core/core-eval.c
@@ -2778,8 +2778,7 @@ eval_expression (const char *expr, struct t_hashtable *pointers,
if (ptr_buffer_added)
hashtable_remove (pointers, "buffer");
}
- if (user_vars)
- hashtable_free (user_vars);
+ hashtable_free (user_vars);
if (regex && regex_allocated)
{
regfree (regex);
diff --git a/src/core/core-hdata.c b/src/core/core-hdata.c
index a7ec9cada..cd4d28569 100644
--- a/src/core/core-hdata.c
+++ b/src/core/core-hdata.c
@@ -1404,12 +1404,10 @@ hdata_free (struct t_hdata *hdata)
if (!hdata)
return;
- if (hdata->hash_var)
- hashtable_free (hdata->hash_var);
+ hashtable_free (hdata->hash_var);
free (hdata->var_prev);
free (hdata->var_next);
- if (hdata->hash_list)
- hashtable_free (hdata->hash_list);
+ hashtable_free (hdata->hash_list);
free (hdata->name);
free (hdata);
diff --git a/src/core/core-network.c b/src/core/core-network.c
index fc34a6060..9b9def496 100644
--- a/src/core/core-network.c
+++ b/src/core/core-network.c
@@ -234,8 +234,7 @@ network_load_user_ca_files (int force_display)
end:
if (paths)
string_free_split (paths);
- if (options)
- hashtable_free (options);
+ hashtable_free (options);
network_num_certs_user = num_loaded;
diff --git a/src/core/core-secure-buffer.c b/src/core/core-secure-buffer.c
index 70661d2cf..be2deb343 100644
--- a/src/core/core-secure-buffer.c
+++ b/src/core/core-secure-buffer.c
@@ -244,8 +244,7 @@ secure_buffer_open ()
secure_buffer_display_values = 0;
- if (properties)
- hashtable_free (properties);
+ hashtable_free (properties);
}
if (!secure_buffer)
diff --git a/src/core/hook/hook-line.c b/src/core/hook/hook-line.c
index ed1fcb781..371e06d88 100644
--- a/src/core/hook/hook-line.c
+++ b/src/core/hook/hook-line.c
@@ -205,8 +205,7 @@ hook_line_exec (struct t_gui_line *line)
hook_exec_end ();
- if (hashtable)
- hashtable_free (hashtable);
+ hashtable_free (hashtable);
}
/*
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;
}