aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/malloc-pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libqos/malloc-pc.c')
-rw-r--r--tests/libqos/malloc-pc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
index db1496c667..be1d97f8bb 100644
--- a/tests/libqos/malloc-pc.c
+++ b/tests/libqos/malloc-pc.c
@@ -36,7 +36,7 @@ static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size)
size += (PAGE_SIZE - 1);
- size &= PAGE_SIZE;
+ size &= -PAGE_SIZE;
g_assert_cmpint((s->start + size), <=, s->end);
@@ -67,5 +67,8 @@ QGuestAllocator *pc_alloc_init(void)
/* Respect PCI hole */
s->end = MIN(ram_size, 0xE0000000);
+ /* clean-up */
+ g_free(fw_cfg);
+
return &s->alloc;
}