From nobody Sun Feb 8 18:32:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1635776219; cv=none; d=zohomail.com; s=zohoarc; b=T3GJKYBfvIopjV+9yLyFxo0c/Q1z9RhixaYY7eCKPz69WqyU7Chn2gkTbOISWoCtmNlKFTuXPwn4HK9AMARJZTNWvJP1deUaWCTTdGF9K6h+rfZAurNLVEKIZj6iqPATa557zDWLV7OrKCaTjlaVCZPWLdvU1wG1pt/DXwenCHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635776219; 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=m7AVCglgKPoe2d1McLbZefDiSgtjsENDMg/2GNrx6oI=; b=Y8nDp0hxGHothvBiGGE/Woj8aUf6dzFJjVRVq6eXEwKkBhXrwLRkWU79nTh4cFWQWRiO4wQPP/nG10bh+bGo0AkSWg+8RBNdo2IYZ9pA7uDI+AjSTyf0lA+AqD/oWENWC+zp17JvswisCUJDxmc5j4q4x5lzXWtNWVzcyNDoGBg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635776219252674.9101388890308; Mon, 1 Nov 2021 07:16: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-14-X7lw1rwHOBihc1G4Qvmlwg-1; Mon, 01 Nov 2021 10:16:56 -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 64574100C662; Mon, 1 Nov 2021 14:16:50 +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 4504F6091B; Mon, 1 Nov 2021 14:16: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 129AB4EA31; Mon, 1 Nov 2021 14:16:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A1EGXKi023111 for ; Mon, 1 Nov 2021 10:16:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 598E560C17; Mon, 1 Nov 2021 14:16:33 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id D598F60C0F for ; Mon, 1 Nov 2021 14:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635776218; 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=m7AVCglgKPoe2d1McLbZefDiSgtjsENDMg/2GNrx6oI=; b=Kxkd8ZPExz87B7OXFfzgy1SWyGfx0k2FNXOdsgSu9+KHgI/et3XFpgDnLMwtcooL2GL+y9 vrAp9NAg3fo+sk0Dxgd+6GhVCjaRkQ5+/FsN8cyF1qcJkW05mIh5gBhfw2R8ZXBkjZF9Oa Cxz2Jcx4uzehP3Ixzoq9lvIuEK8xuto= X-MC-Unique: X7lw1rwHOBihc1G4Qvmlwg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 6/7] test: Use g_autofree more Date: Mon, 1 Nov 2021 15:16:18 +0100 Message-Id: <2ffae0f31649ee7420b23f3be3c42eed518e5d87.1635776103.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635776220577100001 Content-Type: text/plain; charset="utf-8" This commit doesn't aim to extinguish every VIR_FREE() call, but only those which were touched by the previous commit. The aim is to drop cleanup/error labels. Signed-off-by: Michal Privoznik --- tests/qemuagenttest.c | 3 +-- tests/qemumonitorjsontest.c | 3 +-- tests/qemumonitortestutils.c | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 402c290056..479f4c0503 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -624,7 +624,7 @@ testQemuAgentCPU(const void *data) { virDomainXMLOption *xmlopt =3D (virDomainXMLOption *)data; g_autoptr(qemuMonitorTest) test =3D qemuMonitorTestNewAgent(xmlopt); - qemuAgentCPUInfo *cpuinfo =3D NULL; + g_autofree qemuAgentCPUInfo *cpuinfo =3D NULL; int nvcpus; int ret =3D -1; =20 @@ -694,7 +694,6 @@ testQemuAgentCPU(const void *data) ret =3D 0; =20 cleanup: - VIR_FREE(cpuinfo); return ret; } =20 diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index e51d6768d5..e4bc656308 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -247,7 +247,7 @@ testQemuMonitorJSONGetVersion(const void *opaque) int major; int minor; int micro; - char *package =3D NULL; + g_autofree char *package =3D NULL; g_autoptr(qemuMonitorTest) test =3D NULL; =20 if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) @@ -337,7 +337,6 @@ testQemuMonitorJSONGetVersion(const void *opaque) ret =3D 0; =20 cleanup: - VIR_FREE(package); return ret; } =20 diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 2c63e95bda..2ca17f7f48 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -997,8 +997,8 @@ qemuMonitorCommonTestNew(virDomainXMLOption *xmlopt, virDomainChrSourceDef *src) { g_autoptr(qemuMonitorTest) test =3D NULL; - char *path =3D NULL; - char *tmpdir_template =3D NULL; + g_autofree char *path =3D NULL; + g_autofree char *tmpdir_template =3D NULL; =20 test =3D g_new0(qemuMonitorTest, 1); =20 @@ -1047,8 +1047,6 @@ qemuMonitorCommonTestNew(virDomainXMLOption *xmlopt, return g_steal_pointer(&test); =20 error: - VIR_FREE(path); - VIR_FREE(tmpdir_template); return NULL; =20 } --=20 2.32.0