[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH 03/21] util: Use glib memory functions in virBitmapNewQuiet



Signed-off-by: Tim Wiederhake <twiederh redhat com>
---
 src/util/virbitmap.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 60fd8491dd..639103e518 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -69,14 +69,8 @@ virBitmapNewQuiet(size_t size)
 
     sz = VIR_DIV_UP(size, VIR_BITMAP_BITS_PER_UNIT);
 
-    if (VIR_ALLOC_QUIET(bitmap) < 0)
-        return NULL;
-
-    if (VIR_ALLOC_N_QUIET(bitmap->map, sz) < 0) {
-        VIR_FREE(bitmap);
-        return NULL;
-    }
-
+    bitmap = g_new0(virBitmap, 1);
+    bitmap->map = g_new0(unsigned long, sz);
     bitmap->nbits = size;
     bitmap->map_len = sz;
     bitmap->map_alloc = sz;
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]