mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -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;
|
struct sockaddr_in other;
|
||||||
SocketIdleData d = { 0, };
|
SocketIdleData d = { 0, };
|
||||||
Chardev *chr;
|
Chardev *chr;
|
||||||
CharBackend *be;
|
CharBackend stack_be, *be = &stack_be;
|
||||||
socklen_t alen = sizeof(other);
|
socklen_t alen = sizeof(other);
|
||||||
int ret;
|
int ret;
|
||||||
char buf[10];
|
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);
|
chr = qemu_chr_new("client", tmp, NULL);
|
||||||
g_assert_nonnull(chr);
|
g_assert_nonnull(chr);
|
||||||
|
|
||||||
be = g_alloca(sizeof(CharBackend));
|
|
||||||
qemu_chr_fe_init(be, chr, &error_abort);
|
qemu_chr_fe_init(be, chr, &error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue