]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Use glib memory functions in virBitmapNewQuiet
authorTim Wiederhake <twiederh@redhat.com>
Fri, 11 Sep 2020 11:42:00 +0000 (13:42 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 11 Sep 2020 16:19:58 +0000 (18:19 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/util/virbitmap.c

index 60fd8491dd6de4c2818d2e8d0eec5f7166fd9d95..639103e518fd62ec8ef112fcbad82d563e57ccca 100644 (file)
@@ -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;