summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-bar-window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c
index 38526a206..001eacab5 100644
--- a/src/gui/gui-bar-window.c
+++ b/src/gui/gui-bar-window.c
@@ -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;