From b1a4cd3fabff636d1f99bbe5e6b3f0b3d52b7439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 27 Jun 2024 18:55:01 +0200 Subject: [PATCH] core: fix crash when deleting a bar that has no items (issue #2138) --- ChangeLog.adoc | 1 + src/gui/gui-bar.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 8602c1337..14b4826ca 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -15,6 +15,7 @@ === Fixed * python: fix crash on quit with Python 3.12 (issue #2046, issue #2126) +* core: fix crash when deleting a bar that has no items (issue #2138) [[v4.3.3]] == Version 4.3.3 (2024-06-22) diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index b2688dbaf..434ab4efe 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -788,6 +788,13 @@ gui_bar_set_items_array (struct t_gui_bar *bar, const char *items) &bar->items_suffix[i][j]); } } + else + { + bar->items_buffer[i] = NULL; + bar->items_prefix[i] = NULL; + bar->items_name[i] = NULL; + bar->items_suffix[i] = NULL; + } } } string_free_split (tmp_array);