From nobody Mon Feb 9 21:36:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824570; cv=none; d=zohomail.com; s=zohoarc; b=kqgC1ry/rU/51BxBdEbxTk7UW3pQiyq/ll3zk3Wg+i1cX+/aEPTZoQdXlAPZaTRIC/oXu979qcKJKv5z/gYDOm+wtyGwtSsoEL2hyq88Rg2XmhzsFrwLEi8BHx7P3bHABoLCk9JS5zOcQCdLWgGoetshSlaau/pXNCAEGFyOqEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824570; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1HMu9dYRb1eKmahgs3sxAJqTO4nrrxJc1EgLnzfVmKQ=; b=aDiNxIBUML9bOF1v9KEXbLY5Kuuw/EOyWg5+gd4w0E3wPNHypicIM6y+i8wrW+JwXiMl8MGbYdNGHogrTu5msk1IE84sf4fdlJtJ9zo6hqG0DzaUptPEvIrGRtb0sN0gcCvW+MZ4LSqiGcl1Rql1UWNaeOCXFnKucTHAXluFbVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599824570880431.05813734296316; Fri, 11 Sep 2020 04:42:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-M_raSFepNaC7gnQdvp5duA-1; Fri, 11 Sep 2020 07:42:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E519C81F00B; Fri, 11 Sep 2020 11:42:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C06E57512C; Fri, 11 Sep 2020 11:42:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8D38E18198E2; Fri, 11 Sep 2020 11:42:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BBgQ5e010613 for ; Fri, 11 Sep 2020 07:42:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 623195D9F7; Fri, 11 Sep 2020 11:42:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id A71AB5D9E8; Fri, 11 Sep 2020 11:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824569; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1HMu9dYRb1eKmahgs3sxAJqTO4nrrxJc1EgLnzfVmKQ=; b=LgOyNi9NMLHOYnQdeTBGle235bTQpumZ3ozXCZCbA6M0qUoaVM7gjY4ipMtrENd1j4fVkw WIolarf0y9u7eIncILC3bOo/N+f5BzwgVJphb4JXXc9FxedwDZPFAwJgQFB6Cw6FbZ1nYJ 3z4m5/+oyFWbIpeSJWxVsNew6FcVPcU= X-MC-Unique: M_raSFepNaC7gnQdvp5duA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/21] util: Use glib memory functions in virBitmapNewQuiet Date: Fri, 11 Sep 2020 13:42:00 +0200 Message-Id: <20200911114218.489636-4-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- 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) =20 sz =3D VIR_DIV_UP(size, VIR_BITMAP_BITS_PER_UNIT); =20 - if (VIR_ALLOC_QUIET(bitmap) < 0) - return NULL; - - if (VIR_ALLOC_N_QUIET(bitmap->map, sz) < 0) { - VIR_FREE(bitmap); - return NULL; - } - + bitmap =3D g_new0(virBitmap, 1); + bitmap->map =3D g_new0(unsigned long, sz); bitmap->nbits =3D size; bitmap->map_len =3D sz; bitmap->map_alloc =3D sz; --=20 2.26.2