From nobody Mon Feb 9 14:03:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1600070546; cv=none; d=zohomail.com; s=zohoarc; b=DfIH+sFeBEeSR8ehO2sMoiWhgNC5sSq0KTnphkYxcvuJ9FSywpZmdKsUKuBU+tyrBI4+HJh7xzLoRybq7++S+5cBVUIo48estdgUeF+bO+f9Qc06Q7XnZJnlIpTAI0b4nyGg4b0CYnUNPKYTdGgrwYxkGw3EO5QLa+Jk56gnQvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600070546; 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=XHa8vB2nrN3x2AqVOi+vQ9tw3Qz6T4ve+CgA8bNftE0=; b=a8J3Dn6li+tfxrflKTJxCb8+C0rhTr6nGyItdeGVgOZ5eDF7O5ZUHyEMrCcbLADJYzdlx211Djw/uhWVyMU6g83AgjgfEwGu9RnNwap/YKC3fOQ4ZsvjQHpF/kQyWtLoueMZJW1oReZFsQR/u35Y5450n4+3MGU25OY4IXh/OTw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 160007054661530.987678880936755; Mon, 14 Sep 2020 01:02:26 -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-162-3XgEOYDmMiCdqL0MvzIfmw-1; Mon, 14 Sep 2020 04:02:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E3C8AF212; Mon, 14 Sep 2020 08:02:18 +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 4BFA160F96; Mon, 14 Sep 2020 08:02:18 +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 17A711832FE0; Mon, 14 Sep 2020 08:02:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08E82DuJ008818 for ; Mon, 14 Sep 2020 04:02:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id D6EA21A268; Mon, 14 Sep 2020 08:02:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-156.ams2.redhat.com [10.36.112.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2079819C66; Mon, 14 Sep 2020 08:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600070545; 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=XHa8vB2nrN3x2AqVOi+vQ9tw3Qz6T4ve+CgA8bNftE0=; b=QI1HVfORh3TREs1t6XkczTyAqPOizSlUhm4HaoLWEvLrXddIYKiqIpgm/iIOi0Idemqgqt jRAqgM6z/Q4XsRslJP3/URwmBMfUcgvGEKv6YpCrGNQlIYNA23f4DbzWuPdahL5e2qvsjB LxIckcdCkB4sg+Su8Ncvn/AkGbEQreA= X-MC-Unique: 3XgEOYDmMiCdqL0MvzIfmw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 6/7] util: Use glib memory functions in virJSONValueGetArrayAsBitmap Date: Mon, 14 Sep 2020 10:01:53 +0200 Message-Id: <20200914080154.26361-7-twiederh@redhat.com> In-Reply-To: <20200914080154.26361-1-twiederh@redhat.com> References: <20200914080154.26361-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.12 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 --- src/util/virjson.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 6921eccb60..ba43d6b667 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1243,8 +1243,7 @@ virJSONValueGetArrayAsBitmap(const virJSONValue *val, if (val->type !=3D VIR_JSON_TYPE_ARRAY) return -1; =20 - if (VIR_ALLOC_N_QUIET(elems, val->data.array.nvalues) < 0) - return -1; + elems =3D g_new0(unsigned long long, val->data.array.nvalues); =20 /* first pass converts array members to numbers and finds the maximum = */ for (i =3D 0; i < val->data.array.nvalues; i++) { --=20 2.26.2