mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
plugins: remove check of NULL pointers before calling weechat_arraylist_free() (issue #865)
This commit is contained in:
@@ -372,8 +372,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
||||
snprintf (str_format_number_empty, sizeof (str_format_number_empty),
|
||||
"%%-%ds", length_max_number);
|
||||
|
||||
if (buflist_list_buffers[item_index])
|
||||
weechat_arraylist_free (buflist_list_buffers[item_index]);
|
||||
weechat_arraylist_free (buflist_list_buffers[item_index]);
|
||||
buflist_list_buffers[item_index] = weechat_arraylist_new (
|
||||
16, 0, 1,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
@@ -567,8 +567,7 @@ fset_command_run_set_cb (const void *pointer, void *data,
|
||||
/* check condition to trigger the fset buffer */
|
||||
if (condition_ok)
|
||||
{
|
||||
if (old_options)
|
||||
weechat_arraylist_free (old_options);
|
||||
weechat_arraylist_free (old_options);
|
||||
free (old_max_length);
|
||||
free (old_filter);
|
||||
|
||||
|
||||
@@ -495,8 +495,7 @@ end:
|
||||
free (dup_ctcp);
|
||||
free (dup_ctcp_upper);
|
||||
free (dup_args);
|
||||
if (list_messages)
|
||||
weechat_arraylist_free (list_messages);
|
||||
weechat_arraylist_free (list_messages);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -243,8 +243,7 @@ logger_backlog_group_messages (struct t_arraylist *lines)
|
||||
|
||||
error:
|
||||
free (message);
|
||||
if (messages)
|
||||
weechat_arraylist_free (messages);
|
||||
weechat_arraylist_free (messages);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -233,8 +233,7 @@ logger_tail_file (const char *filename, int lines)
|
||||
|
||||
error:
|
||||
free (part_of_line);
|
||||
if (list_lines)
|
||||
weechat_arraylist_free (list_lines);
|
||||
weechat_arraylist_free (list_lines);
|
||||
if (fd >= 0)
|
||||
close (fd);
|
||||
return NULL;
|
||||
|
||||
@@ -481,6 +481,9 @@ TEST(CoreArraylist, New)
|
||||
{
|
||||
int initial_size, sorted, allow_duplicates;
|
||||
|
||||
/* free arraylist with NULL pointer */
|
||||
arraylist_free (NULL);
|
||||
|
||||
/*
|
||||
* in order to create an arraylist, initial_size must be >= 0 and a
|
||||
* comparison callback must be given
|
||||
|
||||
Reference in New Issue
Block a user