mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 18:53:12 +02:00
buflist: remove check of NULL pointers before calling free() (issue #865)
This commit is contained in:
@@ -599,8 +599,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
||||
weechat_hashtable_set (buflist_hashtable_extra_vars,
|
||||
"hotlist",
|
||||
(str_hotlist) ? str_hotlist : "");
|
||||
if (str_hotlist)
|
||||
free (str_hotlist);
|
||||
free (str_hotlist);
|
||||
|
||||
/* lag */
|
||||
ptr_lag = weechat_buffer_get_string (ptr_buffer, "localvar_lag");
|
||||
@@ -632,8 +631,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
||||
buflist_hashtable_extra_vars,
|
||||
buflist_hashtable_options_conditions);
|
||||
rc = (condition && (strcmp (condition, "1") == 0));
|
||||
if (condition)
|
||||
free (condition);
|
||||
free (condition);
|
||||
if (!rc)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -328,8 +328,7 @@ buflist_config_change_sort (const void *pointer, void *data,
|
||||
0,
|
||||
&buflist_config_sort_fields_count[i]);
|
||||
|
||||
if (sort)
|
||||
free (sort);
|
||||
free (sort);
|
||||
}
|
||||
|
||||
weechat_hashtable_free (hashtable_pointers);
|
||||
@@ -446,18 +445,15 @@ buflist_config_change_format (const void *pointer, void *data,
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
if (buflist_config_format_buffer_eval)
|
||||
free (buflist_config_format_buffer_eval);
|
||||
free (buflist_config_format_buffer_eval);
|
||||
buflist_config_format_buffer_eval = buflist_config_add_eval_for_formats (
|
||||
weechat_config_string (buflist_config_format_buffer));
|
||||
|
||||
if (buflist_config_format_buffer_current_eval)
|
||||
free (buflist_config_format_buffer_current_eval);
|
||||
free (buflist_config_format_buffer_current_eval);
|
||||
buflist_config_format_buffer_current_eval = buflist_config_add_eval_for_formats (
|
||||
weechat_config_string (buflist_config_format_buffer_current));
|
||||
|
||||
if (buflist_config_format_hotlist_eval)
|
||||
free (buflist_config_format_hotlist_eval);
|
||||
free (buflist_config_format_hotlist_eval);
|
||||
buflist_config_format_hotlist_eval = buflist_config_add_eval_for_formats (
|
||||
weechat_config_string (buflist_config_format_hotlist));
|
||||
|
||||
@@ -859,19 +855,12 @@ buflist_config_free ()
|
||||
}
|
||||
}
|
||||
|
||||
if (buflist_config_format_buffer_eval)
|
||||
{
|
||||
free (buflist_config_format_buffer_eval);
|
||||
buflist_config_format_buffer_eval = NULL;
|
||||
}
|
||||
if (buflist_config_format_buffer_current_eval)
|
||||
{
|
||||
free (buflist_config_format_buffer_current_eval);
|
||||
buflist_config_format_buffer_current_eval = NULL;
|
||||
}
|
||||
if (buflist_config_format_hotlist_eval)
|
||||
{
|
||||
free (buflist_config_format_hotlist_eval);
|
||||
buflist_config_format_hotlist_eval = NULL;
|
||||
}
|
||||
free (buflist_config_format_buffer_eval);
|
||||
buflist_config_format_buffer_eval = NULL;
|
||||
|
||||
free (buflist_config_format_buffer_current_eval);
|
||||
buflist_config_format_buffer_current_eval = NULL;
|
||||
|
||||
free (buflist_config_format_hotlist_eval);
|
||||
buflist_config_format_hotlist_eval = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user