aboutsummaryrefslogtreecommitdiff
path: root/backends/testdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'backends/testdev.c')
-rw-r--r--backends/testdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/testdev.c b/backends/testdev.c
index eba396aeb9..1429152d05 100644
--- a/backends/testdev.c
+++ b/backends/testdev.c
@@ -113,8 +113,8 @@ CharDriverState *chr_testdev_init(void)
TestdevCharState *testdev;
CharDriverState *chr;
- testdev = g_malloc0(sizeof(TestdevCharState));
- testdev->chr = chr = g_malloc0(sizeof(CharDriverState));
+ testdev = g_new0(TestdevCharState, 1);
+ testdev->chr = chr = g_new0(CharDriverState, 1);
chr->opaque = testdev;
chr->chr_write = testdev_write;