diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2022-08-19 16:39:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-09-22 16:38:28 +0100 |
commit | 2d5f4a713d27f2b218b0c5abfa9833953da108d9 (patch) | |
tree | 6602bc4847e274f848412016b1869f7273784c8e /ui/curses.c | |
parent | 29d81e429d16fe8f0f1cd99e63507ca53ca1945c (diff) |
ui/curses: Avoid dynamic stack allocation
Use autofree heap allocation instead of variable-length
array on the stack.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220819153931.3147384-11-peter.maydell@linaro.org
Diffstat (limited to 'ui/curses.c')
-rw-r--r-- | ui/curses.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/curses.c b/ui/curses.c index 861d63244c..de962faa7c 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -69,7 +69,7 @@ static void curses_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { console_ch_t *line; - cchar_t curses_line[width]; + g_autofree cchar_t *curses_line = g_new(cchar_t, width); wchar_t wch[CCHARW_MAX]; attr_t attrs; short colors; |