From nobody Sun Feb 8 13:17:20 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=1666083490; cv=none; d=zohomail.com; s=zohoarc; b=V6N5tGA1E49d1ibUToP75bUg3lhbpQAJoKrVPS2bTsrCWIGMFQYCP/cHnr9S6AdF9FFruDYdFdMGV2U0/CYazHrazbzvdbnJGF3GAEp5uuYhyLwtgGO3tXvxTQhmPanGYkWuwuRILPVwGcmHaHEv06O9K8NyIQHbx3XgMi4hXkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666083490; 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=OSAmQaBDtpQszg80WybrnLQl074hOuGTllR5AkTeLCI=; b=PXbdbT4xS2jXSjUb2mwwFK07VEAgp+yGQIaH/kQqplCNHFnglumc1TbRICDfhrgnZYbKJ95bPDyRYipTN5YH7WRIELfj98kyGYoweJpN/iegRSIuPOBEB6fZts0YO30g5QOpk9a5ofQMZ0xaH4pUIj0/ehU8SD9wD0uZIta7uXA= 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 1666083490313361.30748242185837; Tue, 18 Oct 2022 01:58:10 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-661-rIVxuTqEOOmwLJIrnaRg3w-1; Tue, 18 Oct 2022 04:58:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4881F38041CB; Tue, 18 Oct 2022 08:57:57 +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 2DCED2022E01; Tue, 18 Oct 2022 08:57:57 +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 4C7B91946A41; Tue, 18 Oct 2022 08:57:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 22B0D1946595 for ; Tue, 18 Oct 2022 08:57:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9AD49403032B; Tue, 18 Oct 2022 08:57:51 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40C98403032A for ; Tue, 18 Oct 2022 08:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666083489; 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=OSAmQaBDtpQszg80WybrnLQl074hOuGTllR5AkTeLCI=; b=hkXEmBSeEekGYoeV4QxeX5A5Q1070mGJXeZ8WzkpH3FBMpX+8GBX34Kk8EdmH2ljk7RXOy OeX4rXdxy9eFefYpbc1NJR/6eyr0aM4cuTLvSkGZSNjxSzoFvagydoi1xvBrow1mrQr/AV xB7hCyFqQD74sJTXi0lrpWt5hYv3VAg= X-MC-Unique: rIVxuTqEOOmwLJIrnaRg3w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/5] processNicRxFilterChangedEvent: Free @guestFilter and @hostFilter automatically Date: Tue, 18 Oct 2022 10:57:45 +0200 Message-Id: <5f26eba2e3b5236aefa283c10c415b6a70f44293.1666083387.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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 3.1 on 10.11.54.4 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: 1666083490792100007 Content-Type: text/plain; charset="utf-8"; x-default="true" There's no need to call virNetDevRxFilterFree() explicitly, when corresponding variables can be declared as g_autoptr(virNetDevRxFilter). Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5c75000742..afebae3b93 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3817,8 +3817,8 @@ processNicRxFilterChangedEvent(virDomainObj *vm, qemuDomainObjPrivate *priv =3D vm->privateData; virDomainDeviceDef dev; virDomainNetDef *def; - virNetDevRxFilter *guestFilter =3D NULL; - virNetDevRxFilter *hostFilter =3D NULL; + g_autoptr(virNetDevRxFilter) guestFilter =3D NULL; + g_autoptr(virNetDevRxFilter) hostFilter =3D NULL; int ret; =20 VIR_DEBUG("Received NIC_RX_FILTER_CHANGED event for device %s " @@ -3826,7 +3826,7 @@ processNicRxFilterChangedEvent(virDomainObj *vm, devAlias, vm, vm->def->name); =20 if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0) - goto cleanup; + return; =20 if (!virDomainObjIsActive(vm)) { VIR_DEBUG("Domain is not running"); @@ -3907,10 +3907,6 @@ processNicRxFilterChangedEvent(virDomainObj *vm, =20 endjob: virDomainObjEndJob(vm); - - cleanup: - virNetDevRxFilterFree(hostFilter); - virNetDevRxFilterFree(guestFilter); } =20 =20 --=20 2.37.3