From nobody Sun Feb 8 15:30:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1613656554; cv=none; d=zohomail.com; s=zohoarc; b=U/rp1nImeBdaJ2p7AQDCt3cX2ynIqaIqX1YksKMohKntgqZP/3DfzZz7QLYuuLv8ISKJiixh1PizZruTuNmbU1O9iIaF/om9UfT9ukXyMwKAFnNVWIC8ev2EdCb1uJXZhKSCeBu2dATge0Y6v29uxVw/hxGxOkTm34M48XFZhkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613656554; h=Content-Type:Content-Transfer-Encoding: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=KeoTdzTv5zh3Hpo+cjWkcrgje4NX/JLq/7l+DNBT/Lc=; b=dx5n1C2IJ9MRGubOpyhwSG/9D433plO+7E/4JbEReuvil/CYBHdxSqcjDBWnMO6DtTj0S7HlwzNJ334DpfCUYs+SqEKhxPj/NZY+H+GbmzoJKV+5Pf3oO9ZgpBfUOG+h1RPoEBFNpsTPDGszJt+GU7sm2pbEN6ywqURgmU2SmVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613656553437647.2773044347823; Thu, 18 Feb 2021 05:55:53 -0800 (PST) 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-328-um0qEdWEPr-q-InZoniMzQ-1; Thu, 18 Feb 2021 08:55:47 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D55C81936B66; Thu, 18 Feb 2021 13:55:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AAC842C01F; Thu, 18 Feb 2021 13:55:41 +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 CFB6F4E58E; Thu, 18 Feb 2021 13:55:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11IDtcZS026298 for ; Thu, 18 Feb 2021 08:55:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 692A960BD8; Thu, 18 Feb 2021 13:55:38 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6C085B4B0 for ; Thu, 18 Feb 2021 13:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613656550; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=KeoTdzTv5zh3Hpo+cjWkcrgje4NX/JLq/7l+DNBT/Lc=; b=NtYqGp9WDbos4k/Yw89Jl5z3NUDgVToB6ekSmBLCWC7tIr2z+wNniSOBtkYmkhyRrd55XH XBoFDzPVw5+J/P6kx5pFKXIkTn1pJ4DOY3Mjp3w5gVb2j62wrgDHjrZgjO/zFVR7xe74iW VOaJNA144fPVGq+CbDx12EeyWUvan6k= X-MC-Unique: um0qEdWEPr-q-InZoniMzQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] qemu: monitor: clear cpu props properly in CPUInfoClear Date: Thu, 18 Feb 2021 14:55:28 +0100 Message-Id: <2f42f16e11be2ca78b0bd69786c55af9d3834fff.1613656486.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Stay true to the name of the function and clear the pointer after freeing it. This also silences a bogus Coverity report about a double free in qemuMonitorGetCPUInfo where qemuMonitorCPUInfoClear is called right after allocating a new qemuMonitorCPUInfo to fill out the non-zero defaults. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0476d606f5..151f69acef 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1661,6 +1661,7 @@ qemuMonitorCPUInfoClear(qemuMonitorCPUInfoPtr cpus, VIR_FREE(cpus[i].alias); VIR_FREE(cpus[i].type); virJSONValueFree(cpus[i].props); + cpus[i].props =3D NULL; } } =20 --=20 2.26.2