diff --git a/src/core/core-command.c b/src/core/core-command.c index 552040a2d..a4c1b1525 100644 --- a/src/core/core-command.c +++ b/src/core/core-command.c @@ -3789,8 +3789,7 @@ COMMAND_CALLBACK(item) sargv = string_split_shell (argv_eol[2], &sargc); if (!sargv || (sargc < 3)) { - if (sargv) - string_free_split (sargv); + string_free_split (sargv); COMMAND_ERROR; } @@ -5147,8 +5146,7 @@ COMMAND_CALLBACK(plugin) full_name = dir_search_full_lib_name (argv[2], "plugins"); plugin_load (full_name, 1, plugin_argc, plugin_argv); free (full_name); - if (plugin_argv) - string_free_split (plugin_argv); + string_free_split (plugin_argv); return WEECHAT_RC_OK; } @@ -5173,8 +5171,7 @@ COMMAND_CALLBACK(plugin) { plugin_reload_name (argv[2], plugin_argc, plugin_argv); } - if (plugin_argv) - string_free_split (plugin_argv); + string_free_split (plugin_argv); } else plugin_reload_name (argv[2], 0, NULL); diff --git a/src/core/core-config-file.c b/src/core/core-config-file.c index a58051c09..156035e40 100644 --- a/src/core/core-config-file.c +++ b/src/core/core-config-file.c @@ -4014,8 +4014,7 @@ config_file_option_free_data (struct t_config_option *option) free (option->name); free (option->parent_name); free (option->description); - if (option->string_values) - string_free_split (option->string_values); + string_free_split (option->string_values); free (option->default_value); free (option->value); free (option->callback_check_value_data); diff --git a/src/core/core-config.c b/src/core/core-config.c index 107036805..73f9bb542 100644 --- a/src/core/core-config.c +++ b/src/core/core-config.c @@ -2930,10 +2930,8 @@ config_weechat_filter_read_cb (const void *pointer, void *data, gui_filter_new ((string_strcasecmp (argv[0], "on") == 0) ? 1 : 0, option_name, argv[1], argv[2], argv_eol[3]); } - if (argv) - string_free_split (argv); - if (argv_eol) - string_free_split (argv_eol); + string_free_split (argv); + string_free_split (argv_eol); } return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; diff --git a/src/core/core-dir.c b/src/core/core-dir.c index 1cddcccf9..af6d4e4bd 100644 --- a/src/core/core-dir.c +++ b/src/core/core-dir.c @@ -356,8 +356,7 @@ dir_set_home_path (char *path) rc = 1; end: - if (paths) - string_free_split (paths); + string_free_split (paths); return rc; } diff --git a/src/core/core-eval.c b/src/core/core-eval.c index dff54a089..579ea816a 100644 --- a/src/core/core-eval.c +++ b/src/core/core-eval.c @@ -626,11 +626,9 @@ end: free (str_number); free (separators); free (str_flags); - if (list_flags) - string_free_split (list_flags); + string_free_split (list_flags); free (strip_items); - if (items) - string_free_split (items); + string_free_split (items); return (value) ? value : strdup (""); } @@ -726,8 +724,7 @@ eval_string_split_shell (const char *text) end: free (str_number); - if (items) - string_free_split (items); + string_free_split (items); return (value) ? value : strdup (""); } diff --git a/src/core/core-input.c b/src/core/core-input.c index ecb4e9380..f3bddfa5b 100644 --- a/src/core/core-input.c +++ b/src/core/core-input.c @@ -224,8 +224,7 @@ end: free (command); free (command_name); - if (new_commands_allowed) - string_free_split (new_commands_allowed); + string_free_split (new_commands_allowed); input_commands_allowed = old_commands_allowed; return rc; diff --git a/src/core/core-network.c b/src/core/core-network.c index 9b9def496..ced066e47 100644 --- a/src/core/core-network.c +++ b/src/core/core-network.c @@ -232,8 +232,7 @@ network_load_user_ca_files (int force_display) } end: - if (paths) - string_free_split (paths); + string_free_split (paths); hashtable_free (options); network_num_certs_user = num_loaded; diff --git a/src/core/core-string.c b/src/core/core-string.c index 3c25b68f9..8e9917b96 100644 --- a/src/core/core-string.c +++ b/src/core/core-string.c @@ -3044,8 +3044,7 @@ string_split_tags (const char *tags, int *num_tags) tags_array[tags_count] = NULL; } } - if (tags_array_temp) - string_free_split (tags_array_temp); + string_free_split (tags_array_temp); } if (num_tags) diff --git a/src/core/core-upgrade-file.c b/src/core/core-upgrade-file.c index baa27e379..2a90d96a7 100644 --- a/src/core/core-upgrade-file.c +++ b/src/core/core-upgrade-file.c @@ -403,8 +403,7 @@ upgrade_file_write_object (struct t_upgrade_file *upgrade_file, int object_id, } } } - if (argv) - string_free_split (argv); + string_free_split (argv); } /* write object end */ diff --git a/src/core/core-util.c b/src/core/core-util.c index 82b2ece3e..d3cbd4a8f 100644 --- a/src/core/core-util.c +++ b/src/core/core-util.c @@ -655,8 +655,7 @@ util_version_number (const char *version) } } } - if (items) - string_free_split (items); + string_free_split (items); return (version_int[0] << 24) | (version_int[1] << 16) | (version_int[2] << 8) | version_int[3]; diff --git a/src/core/hook/hook-command.c b/src/core/hook/hook-command.c index 26a858ed7..e6ac7781e 100644 --- a/src/core/hook/hook-command.c +++ b/src/core/hook/hook-command.c @@ -493,8 +493,7 @@ error: arraylist_free (args); if (result) string_dyn_free (result, 1); - if (lines) - string_free_split (lines); + string_free_split (lines); return NULL; } diff --git a/src/core/hook/hook-process.c b/src/core/hook/hook-process.c index 41c9df12a..b0a3c1da1 100644 --- a/src/core/hook/hook-process.c +++ b/src/core/hook/hook-process.c @@ -361,8 +361,7 @@ hook_process_child (struct t_hook *hook_process) } /* should not be executed if execvp was OK */ - if (exec_args) - string_free_split (exec_args); + string_free_split (exec_args); fprintf (stderr, "Error with command '%s'\n", HOOK_PROCESS(hook_process, command)); } diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index 0b02b6951..4e1fcf3c8 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -877,8 +877,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, } } } - if (items) - string_free_split (items); + string_free_split (items); free (content); } else diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c index f2b0e3750..89196ee21 100644 --- a/src/gui/gui-bar-window.c +++ b/src/gui/gui-bar-window.c @@ -965,8 +965,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window, { for (sub = 0; sub < bar_window->items_subcount[i]; sub++) { - if (split_items[i][sub]) - string_free_split (split_items[i][sub]); + string_free_split (split_items[i][sub]); } free (split_items[i]); } diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 456b8bdce..f8104ca9a 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -684,8 +684,7 @@ gui_bar_free_items_arrays (struct t_gui_bar *bar) for (i = 0; i < bar->items_count; i++) { - if (bar->items_array[i]) - string_free_split (bar->items_array[i]); + string_free_split (bar->items_array[i]); for (j = 0; j < bar->items_subcount[i]; j++) { free (bar->items_buffer[i][j]); diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 14c0b910d..cb36e02ff 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1908,10 +1908,8 @@ gui_buffer_add_highlight_words (struct t_gui_buffer *buffer, weelist_free (list); - if (current_words) - string_free_split (current_words); - if (add_words) - string_free_split (add_words); + string_free_split (current_words); + string_free_split (add_words); } /* @@ -1964,10 +1962,8 @@ gui_buffer_remove_highlight_words (struct t_gui_buffer *buffer, weelist_free (list); - if (current_words) - string_free_split (current_words); - if (remove_words) - string_free_split (remove_words); + string_free_split (current_words); + string_free_split (remove_words); } /* diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index 1411f8a37..689270628 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -1183,8 +1183,7 @@ gui_color_decode_ansi_cb (void *data, const char *text) } end: - if (items) - string_free_split (items); + string_free_split (items); free (text2); return (output) ? output : strdup (""); diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c index 5ec2051e2..c7caadc8d 100644 --- a/src/gui/gui-filter.c +++ b/src/gui/gui-filter.c @@ -540,8 +540,7 @@ gui_filter_free (struct t_gui_filter *filter) /* free data */ free (filter->name); free (filter->buffer_name); - if (filter->buffers) - string_free_split (filter->buffers); + string_free_split (filter->buffers); free (filter->tags); if (filter->tags_array) string_free_split_tags (filter->tags_array); diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 10f2f378d..a153ba99a 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -2494,10 +2494,8 @@ gui_key_pressed (const char *key_str) break; } - if (chunks1) - string_free_split (chunks1); - if (chunks2) - string_free_split (chunks2); + string_free_split (chunks1); + string_free_split (chunks2); if (ptr_key) { @@ -2635,8 +2633,7 @@ gui_key_free (int context, /* free memory */ free (key->key); - if (key->chunks) - string_free_split (key->chunks); + string_free_split (key->chunks); for (i = 0; i < 2; i++) { free (key->area_name[i]); diff --git a/src/gui/gui-nick.c b/src/gui/gui-nick.c index f278904c9..5c71f26bf 100644 --- a/src/gui/gui-nick.c +++ b/src/gui/gui-nick.c @@ -324,8 +324,7 @@ gui_nick_find_color_name (const char *nickname, int case_range, end: result = strdup ((ptr_result) ? ptr_result : default_color); - if (list_colors) - string_free_split (list_colors); + string_free_split (list_colors); free (nickname2); free (nickname3); return result; diff --git a/src/plugins/plugin-api-info.c b/src/plugins/plugin-api-info.c index bc887aa9e..4c1606264 100644 --- a/src/plugins/plugin-api-info.c +++ b/src/plugins/plugin-api-info.c @@ -858,8 +858,7 @@ plugin_api_info_nick_color_cb (const void *pointer, void *data, -1, (num_items >= 2) ? items[1] : NULL); - if (items) - string_free_split (items); + string_free_split (items); return result; } @@ -888,8 +887,7 @@ plugin_api_info_nick_color_name_cb (const void *pointer, void *data, -1, (num_items >= 2) ? items[1] : NULL); - if (items) - string_free_split (items); + string_free_split (items); return result; } @@ -928,8 +926,7 @@ plugin_api_info_nick_color_ignore_case_cb (const void *pointer, void *data, case_range, (num_items >= 3) ? items[2] : NULL); - if (items) - string_free_split (items); + string_free_split (items); return result; } @@ -968,8 +965,7 @@ plugin_api_info_nick_color_name_ignore_case_cb (const void *pointer, void *data, case_range, (num_items >= 3) ? items[2] : NULL); - if (items) - string_free_split (items); + string_free_split (items); return result; } @@ -1119,8 +1115,7 @@ plugin_api_info_totp_generate_cb (const void *pointer, void *data, return totp; error: - if (argv) - string_free_split (argv); + string_free_split (argv); free (totp); return NULL; } @@ -1191,8 +1186,7 @@ plugin_api_info_totp_validate_cb (const void *pointer, void *data, return strdup (value); error: - if (argv) - string_free_split (argv); + string_free_split (argv); return NULL; }