mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: fix malloc(0) when building content of a bar using a filling with columns
This commit is contained in:
@@ -838,7 +838,8 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
|
||||
|
||||
/* build array with pointers to split items */
|
||||
|
||||
linear_items = malloc (total_items * sizeof (*linear_items));
|
||||
linear_items = (total_items > 0) ?
|
||||
malloc (total_items * sizeof (*linear_items)) : NULL;
|
||||
if (linear_items)
|
||||
{
|
||||
index = 0;
|
||||
|
||||
Reference in New Issue
Block a user