From nobody Mon Apr 29 17:28:48 2024 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=1591868639; cv=none; d=zohomail.com; s=zohoarc; b=dT15CAWg2yuO/FkyVK88MRLjRaW+uPebc03Xx7IkEQeIh+iAfSdaUOk/yiT8x0hh8COp2Vm3OWywevUpZ2oyRDfFHz9tBgDhqEhKCTPqHg61USKe2qm3n4GqgNd/Z/MrYMpV7Uu4wXCB+2zYlIV0uo+o2YeXlYTsNdfAohOMbqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868639; 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=9jXQKlt9rUaxlbYw/vlN9cYxPAR1kbCbXl27cgY/hSs=; b=eU6sO3QR6qmmgNCsJvypio9cTaG2C+GmlDkaHnYQXaRIEJPfY8XM6M45GEPPIZ7cj90LT5O9VGDQM6wd0iGwZhl45f3ijjjQVFiBEB0wYdX3epQr1T6hVIFYEA9ICUd8LNfwhPeU10wMO4eGgvmB7xtApb3aoI/20ZZOjEBVgZ4= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1591868639363976.6508914540639; Thu, 11 Jun 2020 02:43:59 -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-46-Ofi8XTN0Od6Biqzz70WPWw-1; Thu, 11 Jun 2020 05:43:55 -0400 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 AABA51005513; Thu, 11 Jun 2020 09:43:49 +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 54ECA5C3E7; Thu, 11 Jun 2020 09:43:49 +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 BA86CB34AC; Thu, 11 Jun 2020 09:43:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hjD4030231 for ; Thu, 11 Jun 2020 05:43:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4E8C77C3B7; Thu, 11 Jun 2020 09:43:45 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1B0B78914 for ; Thu, 11 Jun 2020 09:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868638; 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=9jXQKlt9rUaxlbYw/vlN9cYxPAR1kbCbXl27cgY/hSs=; b=Q/u1QaBtxRP8ZbLxpD8DMRHszRdtBwDoYeU56Ghj9uPKjXcNjhAnx+oQm4ELSkmWrdKr1a t3EmG0dwmzHpZBZrE+tQLwiLVRbInHMdbh2AJuoo2HHPHMZibXiHI27fiqu5e5cLTbri40 3PK/C6cHTBvpwY5gh1rnNjvKjFlf0vI= X-MC-Unique: Ofi8XTN0Od6Biqzz70WPWw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/7] libxlDomainMigrationDstPrepareDef: remove use of temporary variable Date: Thu, 11 Jun 2020 11:43:33 +0200 Message-Id: <6697c931c077bf650ac9bcd2f396bef5107c270e.1591868343.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We can free 'def->name' directly. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/libxl/libxl_migration.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index defdda5ed6..9d253346eb 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -449,7 +449,6 @@ libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr= driver, { libxlDriverConfigPtr cfg =3D libxlDriverConfigGet(driver); virDomainDefPtr def; - char *name =3D NULL; if (!dom_xml) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -464,13 +463,12 @@ libxlDomainMigrationDstPrepareDef(libxlDriverPrivateP= tr driver, goto cleanup; if (dname) { - name =3D def->name; + VIR_FREE(def->name); def->name =3D g_strdup(dname); } cleanup: virObjectUnref(cfg); - VIR_FREE(name); return def; } --=20 2.26.2 From nobody Mon Apr 29 17:28:48 2024 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=1591868639; cv=none; d=zohomail.com; s=zohoarc; b=CykpCqiHGbAUA9SlBifmVzsnewquEYjs/KPAhX7N40BgygYBpbUjNjw6sieEemfvR0z7P9VQ3iQVXS+OOhNEjx82X9hZfgbPxAtp6w6U7YStXh6MnnfK7XnjSvBuE5a5ZqVuH1Ptci2U8YkR+O8yBMYFphwvfknX2azN/h0SKAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868639; 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=VRxr7pPTa2YD1HZEHDrR9CDCdZ4C7O+W5hloNf4ompE=; b=ESqTH1KB1tdNUHbyU7/0+BCfprWdIiQ2UmRmbmqM6FSAd3bCYwB6qFKkVCvFeyAyv3ez9OHz7gwLQo0fRO8KlJNqegv5Pla3ND9VgDL/A+Jo7jmO16xKvIbX9h3QU2IW2GmWulqBefB6w+rGAYO9N6mnhTC5eZeLBVolv/urYpk= 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 1591868639035391.9585804695881; Thu, 11 Jun 2020 02:43:59 -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-155-S-cpF3SPP4-ILo-j1w3__g-1; Thu, 11 Jun 2020 05:43:55 -0400 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 9F4941007271; Thu, 11 Jun 2020 09:43:50 +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 5FD7B5C3F8; Thu, 11 Jun 2020 09:43:49 +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 0CBDC1809547; Thu, 11 Jun 2020 09:43:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hk52030240 for ; Thu, 11 Jun 2020 05:43:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 395D17C3B7; Thu, 11 Jun 2020 09:43:46 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2DCA78914 for ; Thu, 11 Jun 2020 09:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868637; 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=VRxr7pPTa2YD1HZEHDrR9CDCdZ4C7O+W5hloNf4ompE=; b=gqYREbyIZ2PNoHUA7qrNNBJNasGgwCJkVvgtSpIWU9CfPyOVjYq6+Rkh4CTeI80tjp2YNA hWxM5UCgw7uqW9SpxUUVOrS/msHHwE9LbdJMXxrrAw8oC4qrKaREmPgMBDgNDMY5OV4uEf hYdsNqh/P0AtAojykjV8aD3K05KeND4= X-MC-Unique: S-cpF3SPP4-ILo-j1w3__g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/7] testVirFindSCSIHostByPCI: Remove unused 'path_addr' Date: Thu, 11 Jun 2020 11:43:34 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The path is formatted but then just freed without any use. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/scsihosttest.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/scsihosttest.c b/tests/scsihosttest.c index b58318d295..4b2779eabf 100644 --- a/tests/scsihosttest.c +++ b/tests/scsihosttest.c @@ -202,12 +202,9 @@ testVirFindSCSIHostByPCI(const void *data G_GNUC_UNUSE= D) unsigned int unique_id2 =3D 2; const char *pci_addr1 =3D "0000:00:1f.1"; const char *pci_addr2 =3D "0000:00:1f.2"; - char *path_addr =3D NULL; char *ret_host =3D NULL; int ret =3D -1; - path_addr =3D g_strdup_printf("%s/%s", abs_srcdir, "sysfs/class/scsi_h= ost"); - if (!(ret_host =3D virSCSIHostFindByPCI(TEST_SCSIHOST_CLASS_PATH, pci_addr1, unique_id1)) || STRNEQ(ret_host, "host0")) @@ -236,7 +233,6 @@ testVirFindSCSIHostByPCI(const void *data G_GNUC_UNUSED) cleanup: VIR_FREE(ret_host); - VIR_FREE(path_addr); return ret; } --=20 2.26.2 From nobody Mon Apr 29 17:28:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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=1591868686; cv=none; d=zohomail.com; s=zohoarc; b=nL5VqJ7FHOSiDAA4n8WU4HXe8dJ9ioRl3WYYY+zYmKIxbDER9RCAr2Z8SPCcUps7hktzt60DnNbPMFVsoThdDoiFrftyD9NAFv6cSFU5hjGCQaa1/7GF2joXnDcPEjx8P6L/2r5Wnd+6xnHMtqKowa7Qr0a1W5HjfWliSnlkU4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868686; 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=Yxuu9wVvXbge4d61dSNdJ/UfLvc0BznijUQVxNguoew=; b=d9tRPKNTHUasiwHhR1t4TWvqcf7lUWT6oWeB0c/1S6v3c+1b9TnfvIb1FbYUhtywoaFbK0GGT81Sd2aossv49uFP/FJHSqInC0lMzxjdQPyYaOe8qfnoPaGOQgMbEPXgL/Chd+gBMD1oR9yuB+z6mSqHFUpx7JwT50HqwOWO3uc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1591868686956756.2658830904053; Thu, 11 Jun 2020 02:44:46 -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-460-Zy9k0FXXPDaiKu_kxVQWag-1; Thu, 11 Jun 2020 05:44:43 -0400 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 2FD951883608; Thu, 11 Jun 2020 09:44:38 +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 117FF5C296; Thu, 11 Jun 2020 09:44:38 +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 D77761809554; Thu, 11 Jun 2020 09:44:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hldv030250 for ; Thu, 11 Jun 2020 05:43:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D77078914; Thu, 11 Jun 2020 09:43:47 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 973687C3C5 for ; Thu, 11 Jun 2020 09:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868685; 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=Yxuu9wVvXbge4d61dSNdJ/UfLvc0BznijUQVxNguoew=; b=VCxQWgi3jDkUg6u9nyYLlbyp8uuVbJl/puAMvrb82B5YK1HHXU5tckjzpRtGIUyEnkKY5G /a5ftFC9NgzNpjCjImE34uMKn5hjuwqUkEcc36jOnCfrEe+xVUeEz2mBKroeU3AEmcTpc/ CFgx/frqgUnS6Jpy2O+hw/aWpkyvyiY= X-MC-Unique: Zy9k0FXXPDaiKu_kxVQWag-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] cputest: Avoid use of temporary variable in DO_TEST macro Date: Thu, 11 Jun 2020 11:43:35 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use g_free directly to free the returned pointer from virTestLogContentAndReset rather than store it in a temp variable. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/cputest.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index b66ea7850e..0cf6870574 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -997,10 +997,8 @@ mymain(void) flags, result \ }; \ char *testLabel; \ - char *tmp; \ \ - tmp =3D virTestLogContentAndReset(); \ - VIR_FREE(tmp); \ + g_free(virTestLogContentAndReset());\ \ testLabel =3D g_strdup_printf("%s(%s): %s", #api, \ virArchToString(arch), name); \ --=20 2.26.2 From nobody Mon Apr 29 17:28:48 2024 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=1591868689; cv=none; d=zohomail.com; s=zohoarc; b=law1OpviT2E6Fgy0P8vkEWKvkW6wuQXGAncZVPNXez/pU57GwuDa4POtoivUPF7emhoLh2MvhPjGK7snL4c1fAZCN26qml2UYhFvdxkZWEzyYC78etwg2ky0RivrXeUnBn5PNBFMY1s/3wKDW7oOQ/AymSrvk2gg9lE4I5i1seA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868689; 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=ttnlm7hOnp2KxYLEq9ptwZP6gOiRgxanF/xUOXVp90A=; b=UtGz7gb6649zesFyazBq7ib0VJ5NTfCp0pT3iocmAkkaalJsT28yEPOeCPQ+QaSnpp7Vhb16GHqWWQuupKa8jvOb8EDChmaL81Y/yFpLTVaEPueegVj9H1w54hBDL8OLVLeLsCtYxlmjMME25/2Qz/3YOdiOQzC9WPTw28OHpiM= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1591868689165925.4721993635139; Thu, 11 Jun 2020 02:44:49 -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-298-pJ5GaiOUPVe-swhiTEHAwQ-1; Thu, 11 Jun 2020 05:44:45 -0400 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 855C18018A5; Thu, 11 Jun 2020 09:44:40 +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 64D765C5D9; Thu, 11 Jun 2020 09:44:40 +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 35F02B34B9; Thu, 11 Jun 2020 09:44:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hmwL030255 for ; Thu, 11 Jun 2020 05:43:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 22FE87C3B7; Thu, 11 Jun 2020 09:43:48 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BF1378914 for ; Thu, 11 Jun 2020 09:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868687; 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=ttnlm7hOnp2KxYLEq9ptwZP6gOiRgxanF/xUOXVp90A=; b=IlwB2maF653swTgvBti2klw4Fdnxp/9J/gtanY+qYgAprv/aBrSy5jKhz7rCgtjFjmxjWJ TXP1snSlH0E2kt8zE5fV508maybTEaj8BW8q+nNnkYJXAfak7oPJ/PufLdOAokeiotgt1b b2nMgybuwFD7BfllyM/MhP5VjzTB518= X-MC-Unique: pJ5GaiOUPVe-swhiTEHAwQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/7] virTPMEmulatorInit: Don't use temporary variable to free path Date: Thu, 11 Jun 2020 11:43:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use VIR_FREE directly. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virtpm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index c734bf941a..71c1a2ecb3 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -290,7 +290,6 @@ virTPMEmulatorInit(void) g_autofree char *path =3D NULL; bool findit =3D *prgs[i].path =3D=3D NULL; struct stat statbuf; - char *tmp; if (!findit) { /* has executables changed? */ @@ -303,9 +302,7 @@ virTPMEmulatorInit(void) } if (findit) { - tmp =3D *prgs[i].path; - VIR_FREE(tmp); - *prgs[i].path =3D NULL; + VIR_FREE(*prgs[i].path); path =3D virFindFileInPath(prgs[i].name); if (!path) { --=20 2.26.2 From nobody Mon Apr 29 17:28:48 2024 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=1591868645; cv=none; d=zohomail.com; s=zohoarc; b=Yhit70HFdBZLAzfzClpaR2HV5u+FaG3csylKAJNKutVXygRiM7DxHoLyhiCd0PysNrCdTuifP5k0UVva38ZVMETuasbhHBG3AfYcomAe1ZW4e1M5MjftZEK8MsazLGA+Om0WQxys9roduzJ3zmOzXeuHOxysU4m3n3SPlMZ635s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868645; 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=CAEkfdOAnoRvmx4PR7+lfde54O2sMGdexFZ7ESxwkvo=; b=KYTrkBOfCxZh9bbKtxfh36Gbp+caB1/CSVfDhxj8iFrZpnH50d0pDV8QUErTkl2b+weTNhNp83LyA5OApIUe9xGk/KFt/80s+ru2Qf2VZfydchF35QY2GHHE5Z/hUboYj9na6WJ5nFbtu8/1lS8ZmrooWjiyWJ963IoCVYh78Dw= 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 1591868645900714.5523657512106; Thu, 11 Jun 2020 02:44:05 -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-368-hHowVpJ4PXaGXrfQRtoGfA-1; Thu, 11 Jun 2020 05:44:02 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D193910082EA; Thu, 11 Jun 2020 09:43:55 +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 AE9A08929B; Thu, 11 Jun 2020 09:43:55 +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 7B091B34B9; Thu, 11 Jun 2020 09:43:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hnW6030262 for ; Thu, 11 Jun 2020 05:43:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19E697C3B7; Thu, 11 Jun 2020 09:43:49 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 834D878914 for ; Thu, 11 Jun 2020 09:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868644; 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=CAEkfdOAnoRvmx4PR7+lfde54O2sMGdexFZ7ESxwkvo=; b=WrtyrOD/3b7IXdJh+lUXBJk+7jeORSZL98WtbC6bRNjY9SeR8UeSbn4Zi1nmbFp93s4W+S BqI4jKBUygdUhNE8Fz/xD/UcrMn1sF7xtzNlCNgGgHH84K8wgDdeYh5zLtSnC8PJX5SXNI hqP+pzgzVeqlKaFghTY0BoJ+8qzmtws= X-MC-Unique: hHowVpJ4PXaGXrfQRtoGfA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/7] remoteDispatchDomainMigratePrepare: Don't pass uninitialized variable to VIR_FREE Date: Thu, 11 Jun 2020 11:43:37 +0200 Message-Id: <3a9f7ebd416bd5289f29940a3dba65aaa440f97a.1591868343.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 'uri_out' may be passed to VIR_FREE uninitialized if 'conn' is NULL. Unfortunately the compiler isn't able to detect this problem when VIR_FREE is implemented using g_clear_pointer. Initialize the variable. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/remote/remote_daemon_dispatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 6f67d2fb30..69e9aa09b9 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -3030,7 +3030,7 @@ remoteDispatchDomainMigratePrepare(virNetServerPtr se= rver G_GNUC_UNUSED, char *cookie =3D NULL; int cookielen =3D 0; char *uri_in; - char **uri_out; + char **uri_out =3D NULL; char *dname; int rv =3D -1; virConnectPtr conn =3D remoteGetHypervisorConn(client); --=20 2.26.2 From nobody Mon Apr 29 17:28:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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=1591868777; cv=none; d=zohomail.com; s=zohoarc; b=J9HKQcD8Ml1KjSvZQ7iKeaurtdxZegPnn8WxcZqnBPIlb34viuAuslSIBwNMaNLdeAQWApfUsVBbQ7MlBhnmQK4ahzzIcuq44fyrJ+NvfbNUPogSAYfE9mCzRdffsVWNXys9fqR4iEFEf578zG/vZEYjaTwHVeTdtR5uvRFyov0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868777; 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=Eutg/CjMRUnWdQsq4o5aowKUmoQbFayLa4Ux98+EnTI=; b=eRIr0rvb4fyd8lxNf94wfC4n7jSO0Y6WLRoSSMPjJoTHrXM2d34Nursyr7leEfg+G3kXLaqElq2YbBa2N7xh4sYIzux9tghQs7pv0dft8ZBgNrWj9l/gq3qDrH6ZPshpQFg73/Axmq5TP755h3hFkdUontIja3diOAvHuxGRMBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1591868777145759.6884687070942; Thu, 11 Jun 2020 02:46:17 -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-39-QlnprhUaPp6BlvDx2Pw2Hw-1; Thu, 11 Jun 2020 05:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1EF68018AB; Thu, 11 Jun 2020 09:44:42 +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 A02A51A92D; Thu, 11 Jun 2020 09:44:42 +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 725581809563; Thu, 11 Jun 2020 09:44:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hoQa030277 for ; Thu, 11 Jun 2020 05:43:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1813E7C3B7; Thu, 11 Jun 2020 09:43:50 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7872B78914 for ; Thu, 11 Jun 2020 09:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868775; 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=Eutg/CjMRUnWdQsq4o5aowKUmoQbFayLa4Ux98+EnTI=; b=Fae1Ea05KlY3scEXDafECMLxdxUQC5gnebWfxO/vZAgsleRq3PHT97mW3u6J+2javdqPvv pGS/vwhRiaTQXwIF6sKxAVDTT2XghgvKNVhqUSGdZSwcfofTsfXkLl3Klc+u6YTLMnbyBO Lcp5OvcpiIjcHrGg1SAUpTA+kUP1E5M= X-MC-Unique: QlnprhUaPp6BlvDx2Pw2Hw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/7] vboxDomainScreenshot: Don't pass uninitialized 'screenData' to VIR_FREE Date: Thu, 11 Jun 2020 11:43:38 +0200 Message-Id: <232682d28e06d8d373803873b9070a7176a55f22.1591868343.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If one of the early checks to get screen resolution fails 'screenData' would be passed to VIR_FREE uninitialized. Unfortunately the compiler isn't able to detect this when VIR_FREE is implemented using g_clear_pointer. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/vbox/vbox_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index a834a971f0..85935ba731 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -7418,7 +7418,7 @@ vboxDomainScreenshot(virDomainPtr dom, if (display) { PRUint32 width, height, bitsPerPixel; PRUint32 screenDataSize; - PRUint8 *screenData; + PRUint8 *screenData =3D NULL; PRInt32 xOrigin, yOrigin; rc =3D gVBoxAPI.UIDisplay.GetScreenResolution(display, scr= een, --=20 2.26.2 From nobody Mon Apr 29 17:28:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1591868693; cv=none; d=zohomail.com; s=zohoarc; b=Kj1ClB5jbZc8DXmLNKjlRkdeVG23Dbl5APecmtedJHL5jk014iNHf3zPeOtn0w4NPRrRgx7vDN69phJ6YdGUEdYD0EoXbNlRu4mZXKvm+eEwmt58hLHWzd9hv1F2nElWoA//U0QnNPe0OJ34oQpeQbUqLr1dMEwjuqoqWXBujo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591868693; 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=FicEUfTcvVMw19UlPgXQUi6Be2cebdZWkypExT1rwsY=; b=ghpxVXfqkkaUqUpcBFiKmp4PtEOyUq+Jx2D4OR4QgAqSOC2Q3PAEsbhcdjqis89A9HqkS2Wz/rqbaanqtIlKr/OOWUb4IpQiAWo+1NrQ11kdSirUoj8Aq9z6areFqRZeuKWC/UB/8ikOT4YpTvv+iwOI+lhBONc3qfNmAWFzslw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1591868693949910.9347792718834; Thu, 11 Jun 2020 02:44:53 -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-131-8QHxEgQEPv6WJDqT_VjL5A-1; Thu, 11 Jun 2020 05:44:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16AB0107ACF4; Thu, 11 Jun 2020 09:44:45 +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 E93431A92D; Thu, 11 Jun 2020 09:44:44 +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 BAF8E104809; Thu, 11 Jun 2020 09:44:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05B9hpFi030287 for ; Thu, 11 Jun 2020 05:43:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 04F867C3B7; Thu, 11 Jun 2020 09:43:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71FBB78914 for ; Thu, 11 Jun 2020 09:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591868692; 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=FicEUfTcvVMw19UlPgXQUi6Be2cebdZWkypExT1rwsY=; b=QEgNiq66saHD9hD+ZgTw5hTlJ2QFmhPsYXUV1F/lE3nU0eYzBsve2/x82I2py0GDF5fveg uE108MwuoT8t7rbS+WnoLe4dRXpT1AEouSI7vMC+nTyyaQuU7G5jlKbXcitVnp/E240ZD4 5mm2/f5qLKbyjdwF/cyMgJD1SKM+AaI= X-MC-Unique: 8QHxEgQEPv6WJDqT_VjL5A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/7] Remove use of variables passed only to 'VIR_FREE' Date: Thu, 11 Jun 2020 11:43:39 +0200 Message-Id: <3a5b134c07b35e9c2025a9729126bb7aed056879.1591868343.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Compilers are not very good at detecting this problem. Fixed by manual inspection of compilation warnings after replacing 'VIR_FREE' with an empty macro. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/locking/sanlock_helper.c | 2 -- src/logging/log_daemon.c | 2 -- src/nwfilter/nwfilter_ebiptables_driver.c | 2 -- src/openvz/openvz_driver.c | 2 -- src/security/security_selinux.c | 2 -- src/test/test_driver.c | 2 -- src/util/virstorageencryption.c | 4 ---- src/util/virsysinfo.c | 2 -- src/vmware/vmware_conf.c | 4 ---- src/vmware/vmware_driver.c | 4 ---- tests/networkxml2firewalltest.c | 2 -- tests/xmconfigtest.c | 2 -- tools/virsh-checkpoint.c | 2 -- 13 files changed, 32 deletions(-) diff --git a/src/locking/sanlock_helper.c b/src/locking/sanlock_helper.c index 50deccfd67..26f225e639 100644 --- a/src/locking/sanlock_helper.c +++ b/src/locking/sanlock_helper.c @@ -50,7 +50,6 @@ main(int argc, char **argv) const char *uri; const char *uuid; virDomainLockFailureAction action; - char *xml =3D NULL; virConnectPtr conn =3D NULL; virDomainPtr dom =3D NULL; int ret =3D EXIT_FAILURE; @@ -102,7 +101,6 @@ main(int argc, char **argv) virObjectUnref(dom); if (conn) virConnectClose(conn); - VIR_FREE(xml); return ret; } diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 7017db2dcc..028f771f14 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -526,7 +526,6 @@ virLogDaemonPreExecRestart(const char *state_file, char *state =3D NULL; virJSONValuePtr object =3D virJSONValueNewObject(); char *magic; - virHashKeyValuePairPtr pairs =3D NULL; VIR_DEBUG("Running pre-restart exec"); @@ -577,7 +576,6 @@ virLogDaemonPreExecRestart(const char *state_file, abort(); /* This should be impossible to reach */ cleanup: - VIR_FREE(pairs); VIR_FREE(state); virJSONValueFree(object); return -1; diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 235a002495..6fc8044c8d 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3368,7 +3368,6 @@ ebiptablesApplyNewRules(const char *ifname, bool haveEbtables =3D false; bool haveIptables =3D false; bool haveIp6tables =3D false; - char *errmsg =3D NULL; struct ebtablesSubChainInst **subchains =3D NULL; size_t nsubchains =3D 0; int ret =3D -1; @@ -3568,7 +3567,6 @@ ebiptablesApplyNewRules(const char *ifname, virHashFree(chains_in_set); virHashFree(chains_out_set); - VIR_FREE(errmsg); return ret; } diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 0a08c63b1b..79a100c343 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -145,7 +145,6 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) { int ret =3D -1; int vpsid; - char * confdir =3D NULL; virCommandPtr cmd =3D NULL; if (vmdef->nfss > 1) { @@ -194,7 +193,6 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) ret =3D 0; cleanup: - VIR_FREE(confdir); virCommandFree(cmd); return ret; diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index e6819af26c..7359a45a96 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -812,7 +812,6 @@ virSecuritySELinuxGenLabel(virSecurityManagerPtr mgr, { int rc =3D -1; char *mcs =3D NULL; - char *scontext =3D NULL; context_t ctx =3D NULL; const char *range; virSecurityLabelDefPtr seclabel; @@ -949,7 +948,6 @@ virSecuritySELinuxGenLabel(virSecurityManagerPtr mgr, if (ctx) context_free(ctx); - VIR_FREE(scontext); VIR_FREE(mcs); VIR_FREE(sens); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0dc91e1577..7a1db21718 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -8977,7 +8977,6 @@ testDomainCheckpointCreateXML(virDomainPtr domain, { testDriverPtr privconn =3D domain->conn->privateData; virDomainObjPtr vm =3D NULL; - char *xml =3D NULL; virDomainMomentObjPtr chk =3D NULL; virDomainCheckpointPtr checkpoint =3D NULL; virDomainMomentObjPtr current =3D NULL; @@ -9064,7 +9063,6 @@ testDomainCheckpointCreateXML(virDomainPtr domain, } virDomainObjEndAPI(&vm); - VIR_FREE(xml); return checkpoint; } diff --git a/src/util/virstorageencryption.c b/src/util/virstorageencryptio= n.c index 34c356b5a3..94ccaf1e9a 100644 --- a/src/util/virstorageencryption.c +++ b/src/util/virstorageencryption.c @@ -146,8 +146,6 @@ virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, VIR_XPATH_NODE_AUTORESTORE(ctxt); virStorageEncryptionSecretPtr ret; char *type_str =3D NULL; - char *uuidstr =3D NULL; - char *usagestr =3D NULL; if (VIR_ALLOC(ret) < 0) return NULL; @@ -177,8 +175,6 @@ virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, cleanup: VIR_FREE(type_str); virStorageEncryptionSecretFree(ret); - VIR_FREE(uuidstr); - VIR_FREE(usagestr); return NULL; } diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index dc052a7311..52e576f129 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -770,7 +770,6 @@ virSysinfoParseX86BaseBoard(const char *base, char *eol =3D NULL; virSysinfoBaseBoardDefPtr boards =3D NULL; size_t nboards =3D 0; - char *board_type =3D NULL; while (base && (cur =3D strstr(base, "Base Board Information"))) { virSysinfoBaseBoardDefPtr def; @@ -845,7 +844,6 @@ virSysinfoParseX86BaseBoard(const char *base, while (nboards--) virSysinfoBaseBoardDefClear(&boards[nboards]); VIR_FREE(boards); - VIR_FREE(board_type); return ret; } diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 8bea9c3b12..e44673247f 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -132,8 +132,6 @@ vmwareLoadDomains(struct vmware_driver *driver) char *vmxPath =3D NULL; char *vmx =3D NULL; vmwareDomainPtr pDomain; - char *directoryName =3D NULL; - char *fileName =3D NULL; int ret =3D -1; virVMXContext ctx; char *outbuf =3D NULL; @@ -197,8 +195,6 @@ vmwareLoadDomains(struct vmware_driver *driver) virCommandFree(cmd); VIR_FREE(outbuf); virDomainDefFree(vmdef); - VIR_FREE(directoryName); - VIR_FREE(fileName); VIR_FREE(vmx); virObjectUnref(vm); return ret; diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 5b4057a8f6..e82edf2a11 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -400,8 +400,6 @@ vmwareDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int fla virDomainObjPtr vm =3D NULL; virDomainPtr dom =3D NULL; char *vmx =3D NULL; - char *directoryName =3D NULL; - char *fileName =3D NULL; char *vmxPath =3D NULL; vmwareDomainPtr pDomain =3D NULL; virVMXContext ctx; @@ -461,8 +459,6 @@ vmwareDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int fla cleanup: virDomainDefFree(vmdef); VIR_FREE(vmx); - VIR_FREE(directoryName); - VIR_FREE(fileName); VIR_FREE(vmxPath); if (vm) virObjectUnlock(vm); diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltes= t.c index 0ad5e2303b..7b5ada7faa 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -61,7 +61,6 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmdline, const char *baseargs) { - char *expectargv =3D NULL; char *actualargv =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; virNetworkDefPtr def =3D NULL; @@ -94,7 +93,6 @@ static int testCompareXMLToArgvFiles(const char *xml, cleanup: virBufferFreeAndReset(&buf); - VIR_FREE(expectargv); VIR_FREE(actualargv); virNetworkDefFree(def); return ret; diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index 6bd18d0fe1..e4a2b39384 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -129,7 +129,6 @@ testCompareHelper(const void *data) const struct testInfo *info =3D data; char *xml =3D NULL; char *cfg =3D NULL; - char *cfgout =3D NULL; xml =3D g_strdup_printf("%s/xmconfigdata/test-%s.xml", abs_srcdir, inf= o->name); cfg =3D g_strdup_printf("%s/xmconfigdata/test-%s.cfg", abs_srcdir, inf= o->name); @@ -141,7 +140,6 @@ testCompareHelper(const void *data) VIR_FREE(xml); VIR_FREE(cfg); - VIR_FREE(cfgout); return result; } diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index e82a67f075..853fe05fc4 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -471,7 +471,6 @@ cmdCheckpointInfo(vshControl *ctl, virDomainCheckpointPtr checkpoint =3D NULL; const char *name; char *parent =3D NULL; - char *xml =3D NULL; xmlDocPtr xmldoc =3D NULL; xmlXPathContextPtr ctxt =3D NULL; bool ret =3D false; @@ -518,7 +517,6 @@ cmdCheckpointInfo(vshControl *ctl, cleanup: xmlXPathFreeContext(ctxt); xmlFreeDoc(xmldoc); - VIR_FREE(xml); VIR_FREE(parent); virshDomainCheckpointFree(checkpoint); virshDomainFree(dom); --=20 2.26.2