aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chardev/baum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chardev/baum.c b/chardev/baum.c
index 6a210ffd81..0a0d12661a 100644
--- a/chardev/baum.c
+++ b/chardev/baum.c
@@ -299,7 +299,8 @@ static void baum_chr_accept_input(struct Chardev *chr)
static void baum_write_packet(BaumChardev *baum, const uint8_t *buf, int len)
{
Chardev *chr = CHARDEV(baum);
- uint8_t io_buf[1 + 2 * len], *cur = io_buf;
+ g_autofree uint8_t *io_buf = g_malloc(1 + 2 * len);
+ uint8_t *cur = io_buf;
int room;
*cur++ = ESC;
while (len--)