summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2022-08-19 17:39:30 +0200
committerPeter Maydell2022-09-22 17:38:28 +0200
commit2d5f4a713d27f2b218b0c5abfa9833953da108d9 (patch)
tree6602bc4847e274f848412016b1869f7273784c8e /ui
parenthw/usb/hcd-ohci: Use definition to avoid dynamic stack allocation (diff)
downloadqemu-2d5f4a713d27f2b218b0c5abfa9833953da108d9.tar.gz
qemu-2d5f4a713d27f2b218b0c5abfa9833953da108d9.tar.xz
qemu-2d5f4a713d27f2b218b0c5abfa9833953da108d9.zip
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')
-rw-r--r--ui/curses.c2
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;