From nobody Tue Feb 10 07:41:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1661175129; cv=none; d=zohomail.com; s=zohoarc; b=A0+CG3Nx/Q/GqjnbIHLBXbGhqKVEToLCsWvI5fX/PSn9N0bFCTqZg/rPxvGK2kWlB7N/+jcawq/eXGq4/EXZzvarofEyemYSkqjlpmvnR6fhX2Wr8uBfZMRyaI9yjP0d/f9ryOu6iaWJub21jMIuhS88OvxrFugGodb+jCVid4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661175129; 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=6uRjs0ddCCCg1mcZqUOGCvGw25bY1JrbIvOO3yvB4Dg=; b=GFnFVz8JEpE7u9KC+4GfZbGRhET3+SBgcpj7DuUfetSKlKjI0QOgXDhcVpCNe2hPxdkOR2zFEfWsGwVVTkkFwHi8D0Ntys57KPDOTqJ7muJumxPv24eZ/2sLPTpZS+1PAshDYydX6CYdlT+n6p40FGwufUZfJ0KwxxD4waIimGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1661175129028168.75494232624158; Mon, 22 Aug 2022 06:32:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-39-Q3JWGaY6MgKc5HS_mJnZvw-1; Mon, 22 Aug 2022 09:32:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4C171032967; Mon, 22 Aug 2022 13:31:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1D8C945D2; Mon, 22 Aug 2022 13:31:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 915971946A5E; Mon, 22 Aug 2022 13:31:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 04CAD1946A4B for ; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D679B40CFD0B; Mon, 22 Aug 2022 13:31:51 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id C177E40CFD0A for ; Mon, 22 Aug 2022 13:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661175126; 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=6uRjs0ddCCCg1mcZqUOGCvGw25bY1JrbIvOO3yvB4Dg=; b=DpaFCLv8kaQ3tHiT1z2wiBEN7cOkYzNgDooSDfzo86NNMqbEepe4i728y0YY7arX4tVi8x f/NbE6jDwXbNgjgDbN2uGlNc1EGUImF+32o66qLvmscXg2nFlakjsJxXsIQLQBlUtUis2c wJn2e9K+nsXS7oEazNvZ8i2BmOHg+LY= X-MC-Unique: Q3JWGaY6MgKc5HS_mJnZvw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 07/16] tests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef) Date: Mon, 22 Aug 2022 09:31:41 -0400 Message-Id: <20220822133150.1098794-8-laine@redhat.com> In-Reply-To: <20220822133150.1098794-1-laine@redhat.com> References: <20220822133150.1098794-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: 1661175131179100011 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Laine Stump --- tests/networkxml2firewalltest.c | 3 +-- tests/networkxml2xmltest.c | 3 +-- tests/networkxml2xmlupdatetest.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltes= t.c index 2648115a12..f895ca8c56 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -89,7 +89,7 @@ static int testCompareXMLToArgvFiles(const char *xml, { g_autofree char *actualargv =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - virNetworkDef *def =3D NULL; + g_autoptr(virNetworkDef) def =3D NULL; int ret =3D -1; char *actual; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); @@ -117,7 +117,6 @@ static int testCompareXMLToArgvFiles(const char *xml, ret =3D 0; =20 cleanup: - virNetworkDefFree(def); return ret; } =20 diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 5f39162ef1..521f058acc 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -27,7 +27,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *o= utxml, g_autofree char *actual =3D NULL; int ret; testCompareNetXML2XMLResult result =3D TEST_COMPARE_NET_XML2XML_RESULT= _SUCCESS; - virNetworkDef *dev =3D NULL; + g_autoptr(virNetworkDef) dev =3D NULL; g_autoptr(virNetworkXMLOption) xmlopt =3D NULL; =20 if (!(xmlopt =3D networkDnsmasqCreateXMLConf())) @@ -68,7 +68,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *o= utxml, } virResetLastError(); =20 - virNetworkDefFree(dev); return ret; } =20 diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatet= est.c index c50c6c8558..4926609f90 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -20,7 +20,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *= updatexml, g_autofree char *updateXmlData =3D NULL; g_autofree char *actual =3D NULL; int ret =3D -1; - virNetworkDef *def =3D NULL; + g_autoptr(virNetworkDef) def =3D NULL; =20 if (virTestLoadFile(updatexml, &updateXmlData) < 0) goto error; @@ -53,7 +53,6 @@ testCompareXMLToXMLFiles(const char *netxml, const char *= updatexml, } } error: - virNetworkDefFree(def); return ret; } =20 --=20 2.37.1