From nobody Sat May 4 22:30:06 2024 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=1613656619; cv=none; d=zohomail.com; s=zohoarc; b=PB/BdU13acw4zc+5VeCFAUbXy69fh7UwfiCa3mExjzy8JMJYd8XZoYxVhpPZTxShIgFuo8IF2v2w+n2UmsO3ZrVVJS7YnzfuTRnqgoMFIF5NCEH9WdNtAt8VNY/H3XW/i5rc0Lu7wkSs7+HLVMP3gVsuPyyKtqbZ8nbR8B5EiZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613656619; 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=xbNlG26K/6TCTrNF19vgqayZ3rvjvnS5vXez0v95A5E=; b=HqWLdTwzX/wedoaOFSSnL9jWnCHpklSWKFqfdYkRiPXZe9zv1xALkMuLaDD3tJclb9emqZJ5Vbq5zd2uSHI3ExMWj029D4cqJ5EkmBwEb79DnOZP6kRb+iqUhtdMmd8J7uAhnL/cv/FlNvjnQx5hBQjactN0rAPmSm47o1kLHPw= 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 1613656619042102.74475146479836; Thu, 18 Feb 2021 05:56:59 -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-302-il19WNyRMeGeIVSalfmrrg-1; Thu, 18 Feb 2021 08:55:56 -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 150E6100CCC5; Thu, 18 Feb 2021 13:55:51 +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 E3FAA50EDF; Thu, 18 Feb 2021 13:55:50 +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 A113A18095CE; Thu, 18 Feb 2021 13:55:50 +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 11IDtaNQ026282 for ; Thu, 18 Feb 2021 08:55:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id CB60B5B4B0; Thu, 18 Feb 2021 13:55:36 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54A7460BD8 for ; Thu, 18 Feb 2021 13:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613656558; 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=xbNlG26K/6TCTrNF19vgqayZ3rvjvnS5vXez0v95A5E=; b=VCH32iuYqqaue/rGvrof9a5m+OmZwdr0ANv/GE5iIDYmRSqB/EQQ/+wfz6gJigfBxB8EYO 80KUI1+I6ef1O3BNHTUjQfOfXi/nAdtOZJBacQoL9nVmuZFw4Fp+xEG0k9gW5YIxxC1vVP bGYePXfjKW6Lujoj+cnPUY/y0xs6YfY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613656616; 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=xbNlG26K/6TCTrNF19vgqayZ3rvjvnS5vXez0v95A5E=; b=XkoohWeuxCnDAcw+ckNe/2SQdgQ1GSjgWgA1DPM1/umA+d3GAxxrb/hEn7qyvH8ZXSxTVx wqixhuVkC1HgUQiXN8mIWPfPTpCLUQOBWvjTVBdd6EYuW+XP2uwawXMohDTjfeySa+TnL9 UNCIakJyxHkatmvFlvZSP9JPhm294GM= X-MC-Unique: il19WNyRMeGeIVSalfmrrg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] security: dac: remove leftover virPCIDeviceFree Date: Thu, 18 Feb 2021 14:55:26 +0100 Message-Id: <15ae708bce350b8cbe270de601ffc9c770086730.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) (identity @redhat.com) The switch to g_auto left this one call behind. Reported by Coverity. Fixes: 4ab0d1844a1e60def576086edc8b2c3775e7c10d Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- src/security/security_dac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 00eeae0d27..11f6c5c3da 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1430,10 +1430,9 @@ virSecurityDACRestoreHostdevLabel(virSecurityManager= Ptr mgr, if (pcisrc->backend =3D=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { g_autofree char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev= (pci); =20 - if (!vfioGroupDev) { - virPCIDeviceFree(pci); + if (!vfioGroupDev) return -1; - } + ret =3D virSecurityDACRestoreFileLabelInternal(mgr, NULL, vfioGroupDev, fal= se); } else { --=20 2.26.2 From nobody Sat May 4 22:30:06 2024 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=1613656566; cv=none; d=zohomail.com; s=zohoarc; b=HvkMtxorkPlXn3Tew49hANz2eS+iAYne2XAkk75jZPzj97JPdFtQAUkUPP+STJUL4WdYmB6mq3kRNI2PKovSKGR0Qj003eLsYDU7jv0QpCpaLi6lvbcm0Oh1Rv3yhc8hF9YRSBBtfPuCAbSurmQDt2M6jAhrJLW169XaGiZTabI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613656566; 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=1boRhIJ3wWwVnakGuz5pYzh475g1ZVNmG4k+JPqlMIo=; b=MsPqrMbLAQRuC79+YKhE8e2PUGJFZ034ezAQDB0IZODoY2gFkVHV2ixot2bQPr5Dcoqn1tauZLDj5+sq3cgXq1ykGNCxVHGKftz1xtfcoERx1ZDfzjoiD6suk8cOKWE4UPK0DAQFp5Lp2wbOXegdkPeA19OUiLX/lJ0l9JyWe5M= 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 161365656554127.192776645128106; Thu, 18 Feb 2021 05:56:05 -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-450-4uAmBDx2NR-w1hmoS1PCDg-1; Thu, 18 Feb 2021 08:56:01 -0500 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 72854EC1A6; Thu, 18 Feb 2021 13:55:54 +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 5039460C6B; Thu, 18 Feb 2021 13:55:54 +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 162334EEF6; Thu, 18 Feb 2021 13:55:54 +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 11IDtbYA026289 for ; Thu, 18 Feb 2021 08:55:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9A3BD5B4B0; Thu, 18 Feb 2021 13:55:37 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 239756F7E6 for ; Thu, 18 Feb 2021 13:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613656564; 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=1boRhIJ3wWwVnakGuz5pYzh475g1ZVNmG4k+JPqlMIo=; b=eQ/xEUWgHuhENGiP78FCO4X20jN47ZtXAYRkSRI2f7GIKLqbksIvOWA5Jb2SODeX1/nnEI yiQ6YUv21b4WD1lgvGHegWMZ23L7saLwrVwB1yING16lFa5R6WQB6jFczZWWD1BvZK0v43 1f/NmQAiYvy4Kj5JZctvKld2Lr+Y+IQ= X-MC-Unique: 4uAmBDx2NR-w1hmoS1PCDg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] qemu: saveimage: only steal domXML on success Date: Thu, 18 Feb 2021 14:55:27 +0100 Message-Id: <074584849ad7fa2505ac14c3ef5847c83ea53d02.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.12 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) The comment and the caller assume virQEMUSaveDataNew only steals domXML on success, but it is copied even on failure. Also remove the misleading g_steal_pointer call on a local variable. Reported by coverity. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- src/qemu/qemu_saveimage.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index de2d63dd9a..5d542bf977 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -105,8 +105,6 @@ virQEMUSaveDataNew(char *domXML, =20 data =3D g_new0(virQEMUSaveData, 1); =20 - data->xml =3D g_steal_pointer(&domXML); - if (cookieObj && !(data->cookie =3D virSaveCookieFormat((virObjectPtr) cookieObj, virDomainXMLOptionGetSaveCook= ie(xmlopt)))) @@ -118,6 +116,7 @@ virQEMUSaveDataNew(char *domXML, header->was_running =3D running ? 1 : 0; header->compressed =3D compressed; =20 + data->xml =3D domXML; return data; =20 error: --=20 2.26.2 From nobody Sat May 4 22:30:06 2024 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 Reviewed-by: Erik Skultety --- 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 From nobody Sat May 4 22:30:06 2024 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=1613656626; cv=none; d=zohomail.com; s=zohoarc; b=bd5IZBZ70oe3f76FYW7DXdWOL9WdEpFlxWjLF+vwy7pgy7S5sUkbJOwoypfcoB8ABMEiT9Ocv/o5ug8mJyJxdmIzskN7nzESVFwrO6M9HvQnyF/TKrHRSLkoKYVsEGYFRy1Yihv+pomqnpA//FJgOKalT4aTgn8kJ+cTlQ15DgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613656626; 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=CIf98qEPgGj130ebxdCbYJBWHx+4pdz3vGKzVNmKKnw=; b=KvZRzihSB9VJLeHJtjD+iIq63wzFT8IFb0sUQcWrBTGd2E9aQnc7lES9JnrmxYv0rtacGdEhKm3ECFxCGq+j0A6x9ut6CQ8uvvcH/+ukpwmlUF/dlB9LB55OxGxWQ4Ipk72UcWNURCc116lUmr4d5EklaBwLlzUytaEMBPJRy1o= 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 1613656625766565.9219578274235; Thu, 18 Feb 2021 05:57:05 -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-573-Ljpdld10Nu6pbJe3InHTzA-1; Thu, 18 Feb 2021 08:55:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4808D874983; Thu, 18 Feb 2021 13:55:52 +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 21D195C3E5; Thu, 18 Feb 2021 13:55:52 +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 DEE791809C90; Thu, 18 Feb 2021 13:55:51 +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 11IDtdnm026304 for ; Thu, 18 Feb 2021 08:55:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 412AA5B4B0; Thu, 18 Feb 2021 13:55:39 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id B67EA6F7EC for ; Thu, 18 Feb 2021 13:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613656624; 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=CIf98qEPgGj130ebxdCbYJBWHx+4pdz3vGKzVNmKKnw=; b=MhL4MKIwAIQ4VbRLHHHbUK1rI9RGx9ZnxqHdx2fvtFQVgngXnpRfZoDd3ej+VJuUYX08Kn gYK2QlCwdBqu4QyBlU88ArJCfDB8Ci68dddeFBYuWiiunxKGOhY/wR5GQ9ioCwnJcRplCb +HXVuu/9oQyqEFKUQNXQ8StpIsYofUc= X-MC-Unique: Ljpdld10Nu6pbJe3InHTzA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] hyperv: check return value of virUUIDGenerate Date: Thu, 18 Feb 2021 14:55:29 +0100 Message-Id: <9f730bbf82cb1f5699627d2efbe503215964d51d.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.16 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) Fixes: fa66bd8cad2359b7d21676e0fd69bec472b36514 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- src/hyperv/hyperv_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index c1ed4b5c7c..701456cdb3 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1080,7 +1080,9 @@ hypervDomainAttachSyntheticEthernetAdapter(virDomainP= tr domain, */ portResourceType =3D g_strdup_printf("%d", MSVM_RASD_RESOURCETYPE_ETHE= RNET_ADAPTER); =20 - virUUIDGenerate(vsiGuid); + if (virUUIDGenerate(vsiGuid) < 0) + return -1; + virUUIDFormat(vsiGuid, guidString); virtualSystemIdentifiers =3D g_strdup_printf("{%s}", guidString); =20 --=20 2.26.2