From nobody Mon Feb 9 16:54:08 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=1638543659; cv=none; d=zohomail.com; s=zohoarc; b=IYUNLO3SRPau7cAXhgWyt1hXGG8H5yXsfI+krfYJ8Ebb3iW31EGTbYRif2VLjW+Dv8DOkq0rOk1HuPc5P46Mrk++oMrhUcLRiDeFwHlmO36mhSSavcTRPKOWBFmJjcLmgo69Nd3ilFjXi0RLW0mOOiGQL0eIZK/fP8nXkiYR4TE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638543659; 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=N1pfWEtqCxiLKRW6C1q3sBC1eBHX9U7oWztegEnvYWc=; b=O62wcRBrqJrHdOwbYla1x/hVp1uhcMa/BzXO5AICK4pM8kYWWVVtm6JUT3HLbAI6EdEGLEei2Z+YtQe5woY+TzXalsq0Sy/bplceIa0kCZBMssTumEaYkVogYKLO/WvH1rQB5UShcsrZD0IEqTvMMJqcigB3m0NtU3OAj+zBZG0= 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 163854365946120.898751537711405; Fri, 3 Dec 2021 07:00:59 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-187-N1rZE745N0OMabvLf2CUjA-1; Fri, 03 Dec 2021 10:00:47 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94A0B83DD5F; Fri, 3 Dec 2021 15:00:39 +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 07C6C5F4E9; Fri, 3 Dec 2021 15:00:39 +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 837C01806D2C; Fri, 3 Dec 2021 15:00:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B3Evkeh029550 for ; Fri, 3 Dec 2021 09:57:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5704610016FE; Fri, 3 Dec 2021 14:57:46 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id A61FA10016F4 for ; Fri, 3 Dec 2021 14:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638543658; 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=N1pfWEtqCxiLKRW6C1q3sBC1eBHX9U7oWztegEnvYWc=; b=S7lBLDPFp01jZYbvqqtuSQLSbJ0ShrtRoPPpvhrmOUSpmRN3DGSWyGKG03IZrkmvj7Vnlo z9Od0PSdIOzwiikr9EGdhtjO1AxqQNz/bSWkWkzixfe90vUcfocgVQWveEsBuSlrdzUeWS 6tAPkko+cBykYh7pvQ6fqfxw3LNlOxc= X-MC-Unique: N1rZE745N0OMabvLf2CUjA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/16] qemu: hotplug: Use automatic freeing for virJSONValue Date: Fri, 3 Dec 2021 15:57:28 +0100 Message-Id: <08828ca0f7f8bc182b763af084b1ba1130ed7ad9.1638543041.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.15 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: 1638543661538100001 Content-Type: text/plain; charset="utf-8" There are a few uses which still explicitly free JSON objects, fix them. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 71c0686190..2e1d18c633 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -411,7 +411,7 @@ qemuHotplugAttachManagedPR(virQEMUDriver *driver, qemuDomainAsyncJob asyncJob) { qemuDomainObjPrivate *priv =3D vm->privateData; - virJSONValue *props =3D NULL; + g_autoptr(virJSONValue) props =3D NULL; bool daemonStarted =3D false; int ret =3D -1; int rc; @@ -442,7 +442,6 @@ qemuHotplugAttachManagedPR(virQEMUDriver *driver, cleanup: if (ret < 0 && daemonStarted) qemuProcessKillManagedPRDaemon(vm); - virJSONValueFree(props); return ret; } @@ -2286,7 +2285,7 @@ qemuDomainAttachRNGDevice(virQEMUDriver *driver, bool teardowncgroup =3D false; bool teardowndevice =3D false; bool chardevAdded =3D false; - virJSONValue *props =3D NULL; + g_autoptr(virJSONValue) props =3D NULL; int ret =3D -1; qemuAssignDeviceRNGAlias(vm->def, rng); @@ -2349,7 +2348,6 @@ qemuDomainAttachRNGDevice(virQEMUDriver *driver, audit: virDomainAuditRNG(vm, NULL, rng, "attach", ret =3D=3D 0); cleanup: - virJSONValueFree(props); if (ret < 0) { if (releaseaddr) qemuDomainReleaseDeviceAddress(vm, &rng->info); @@ -2403,7 +2401,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, bool teardownlabel =3D false; bool teardowncgroup =3D false; bool teardowndevice =3D false; - virJSONValue *props =3D NULL; + g_autoptr(virJSONValue) props =3D NULL; virObjectEvent *event; int id; int ret =3D -1; @@ -2492,7 +2490,6 @@ qemuDomainAttachMemory(virQEMUDriver *driver, qemuDomainReleaseMemoryDeviceSlot(vm, mem); } - virJSONValueFree(props); virDomainMemoryDefFree(mem); return ret; @@ -2970,7 +2967,7 @@ qemuDomainAttachShmemDevice(virQEMUDriver *driver, bool release_backing =3D false; bool release_address =3D true; virErrorPtr orig_err =3D NULL; - virJSONValue *props =3D NULL; + g_autoptr(virJSONValue) props =3D NULL; qemuDomainObjPrivate *priv =3D vm->privateData; virDomainDeviceDef dev =3D { VIR_DOMAIN_DEVICE_SHMEM, { .shmem =3D shm= em } }; @@ -3046,8 +3043,6 @@ qemuDomainAttachShmemDevice(virQEMUDriver *driver, if (release_address) qemuDomainReleaseDeviceAddress(vm, &shmem->info); - virJSONValueFree(props); - return ret; exit_monitor: --=20 2.31.1