1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

util: Use glib memory functions in virBitmapNewQuiet

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>
This commit is contained in:
Tim Wiederhake 2020-09-11 13:42:00 +02:00 committed by Ján Tomko
parent a922e72756
commit 18216abcfe

View 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;