diff mbox series

[17/88] Memory API: use g_new() family of functions

Message ID 20171006235023.11952-18-f4bug@amsat.org
State New
Headers show
Series use g_new() family of functions | expand

Commit Message

Philippe Mathieu-Daudé Oct. 6, 2017, 11:49 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/memory.c b/memory.c
index 5e6351a6c1..40d30640eb 100644
--- a/memory.c
+++ b/memory.c
@@ -2762,7 +2762,7 @@  void memory_region_invalidate_mmio_ptr(MemoryRegion *mr, hwaddr offset,
     }
 
     if (!invalidate_data) {
-        invalidate_data = g_malloc0(sizeof(MMIOPtrInvalidate));
+        invalidate_data = g_new0(MMIOPtrInvalidate, 1);
         invalidate_data->allocated = 1;
     }