mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
core: remove check of NULL pointers before calling string_free_split() (issue #865)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ("");
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user