From nobody Sun Feb 8 03:38:22 2026 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=1601967676; cv=none; d=zohomail.com; s=zohoarc; b=MaWijXyvINzz1raS0oF0hX+scBo/9dohjZNOnzZY4Nn1o7KYW/4CYsznsjNkgHeD3QuYqJaJa5aWXIU4ukYs5GIX5hgvC7p7ujJKQS4bYyjPdlUidUV+zQwEeEkXA2a2Ma7PLofBvbY2XiM/0Lzrv+EH2OGxO2DfdaipHSAD3EM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601967676; 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=lE8PmuC3MsTI2vgMaxOw/JVvbe2PJZTBcw3PbSo63GI=; b=Y+CejEAL24D3LuyUrcqO/blSgAnhYrBo6dwfg7PpClPJPlt+EOfFz0jNqdtrxrqqE1SaNKK6/ZxezsZE5Ovup8czdR5oXY/DQH22psAOzvtdyXbX16ib47k+Rc/HqdRih8CYURqgorFc7uIkhFN3YJ1gGlwhBOVFeLZOsE3xE3Y= 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 1601967676261824.8555628887223; Tue, 6 Oct 2020 00:01:16 -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-395-6EvjYw5wM7WQt6L2Pb2cBg-1; Tue, 06 Oct 2020 02:59:28 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D3872FD0F; Tue, 6 Oct 2020 06:59:20 +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 DB1A01002C02; Tue, 6 Oct 2020 06:59:19 +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 A6C57181A870; Tue, 6 Oct 2020 06:59:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0966xBVr018684 for ; Tue, 6 Oct 2020 02:59:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5A03D5C221; Tue, 6 Oct 2020 06:59:11 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id D66935C1C4 for ; Tue, 6 Oct 2020 06:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601967675; 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=lE8PmuC3MsTI2vgMaxOw/JVvbe2PJZTBcw3PbSo63GI=; b=bdfI4cJqxJ314vAJj0DPDbEqIIGMpL5vCb9l9ab8Q+WN7LVjSdwz4Ouxo+bLXVN0E5mHpc TCxaXWb+otbRjJH61JeBAIDWczqVKrpxUWPeL0bhM4VRp9maNy1L+lTuZ7oJsckqq/yaUV ZrU9c6EkkNRITaXAe84EOC7u1s4BMq4= X-MC-Unique: 6EvjYw5wM7WQt6L2Pb2cBg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 11/14] qemu: agent: use g_auto in qemuAgentGetInterfaces Date: Tue, 6 Oct 2020 08:58:47 +0200 Message-Id: <3b8dbe667909cd9eef6f8262b3efeb5a55ea55b8.1601967442.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.22 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) Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_agent.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 8cd1aa6cb0..847300c86e 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -2197,12 +2197,12 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, { int ret =3D -1; size_t i; - virJSONValuePtr cmd =3D NULL; - virJSONValuePtr reply =3D NULL; + g_autoptr(virJSONValue) cmd =3D NULL; + g_autoptr(virJSONValue) reply =3D NULL; virJSONValuePtr ret_array =3D NULL; size_t ifaces_count =3D 0; virDomainInterfacePtr *ifaces_ret =3D NULL; - virHashTablePtr ifaces_store =3D NULL; + g_autoptr(virHashTable) ifaces_store =3D NULL; =20 /* Hash table to handle the interface alias */ ifaces_store =3D virHashNew(NULL); @@ -2232,9 +2232,6 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, ret =3D ifaces_count; =20 cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - virHashFree(ifaces_store); return ret; =20 error: --=20 2.26.2