From: Philippe Mathieu-Daudé Date: Fri, 19 Aug 2022 15:39:30 +0000 (+0100) Subject: ui/curses: Avoid dynamic stack allocation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2d5f4a713d27f2b218b0c5abfa9833953da108d9;p=qemu.git ui/curses: Avoid dynamic stack allocation Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-11-peter.maydell@linaro.org --- 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;