From 790bbb9768e6a21920e76989f931db80ca67dc10 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Fri, 6 Oct 2017 20:49:56 -0300 Subject: tests: use g_new() family of functions Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: split of some files in other commits of the same series, add libqtest.c] Acked-by: John Snow Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/libqos/malloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/libqos/malloc.c') diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index b8eff5f495..ac05874b0a 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -129,7 +129,7 @@ static MemBlock *mlist_new(uint64_t addr, uint64_t size) if (!size) { return NULL; } - block = g_malloc0(sizeof(MemBlock)); + block = g_new0(MemBlock, 1); block->addr = addr; block->size = size; @@ -305,8 +305,8 @@ QGuestAllocator *alloc_init(uint64_t start, uint64_t end) s->start = start; s->end = end; - s->used = g_malloc(sizeof(MemList)); - s->free = g_malloc(sizeof(MemList)); + s->used = g_new(MemList, 1); + s->free = g_new(MemList, 1); QTAILQ_INIT(s->used); QTAILQ_INIT(s->free); -- cgit v1.2.3-55-g7522