mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
tests/unit/test-char: Avoid using g_alloca()
Do not use g_alloca(), simply allocate the CharBackend structure on the stack. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20250605193540.59874-4-philmd@linaro.org>
This commit is contained in:
parent
0ff9cd9a6a
commit
2f014eabc1
1 changed files with 1 additions and 2 deletions
|
@ -993,7 +993,7 @@ static void char_udp_test_internal(Chardev *reuse_chr, int sock)
|
|||
struct sockaddr_in other;
|
||||
SocketIdleData d = { 0, };
|
||||
Chardev *chr;
|
||||
CharBackend *be;
|
||||
CharBackend stack_be, *be = &stack_be;
|
||||
socklen_t alen = sizeof(other);
|
||||
int ret;
|
||||
char buf[10];
|
||||
|
@ -1009,7 +1009,6 @@ static void char_udp_test_internal(Chardev *reuse_chr, int sock)
|
|||
chr = qemu_chr_new("client", tmp, NULL);
|
||||
g_assert_nonnull(chr);
|
||||
|
||||
be = g_alloca(sizeof(CharBackend));
|
||||
qemu_chr_fe_init(be, chr, &error_abort);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue