From nobody Fri May 3 02:31:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1561620235; cv=none; d=zoho.com; s=zohoarc; b=a4o+mp79EnbPxzSWvfa3SWAAy/jlgt7OVDoO23PxKqYUO6xpbNiHCSbOnaQrNwwfl2CEDM7SgZC9UFPZWeVSyi6W/m7Mh1blCi699DuwGOhJ7BZT6q9GhaieK12tjiU6Hj0TAcMC/ZSswtANp3bWj262iaAA0xF8TLgYYx2YNyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561620235; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=yO6ZGpuwAxGjJ2Vpd9Luwh0biBvzkOl04b457Y8xe3s=; b=GHYkuQSpajPvl8xXrwcaS8gQucRIeTcsC806vm/8Hfkz5L3tPXt1mDE5ofZP2zQtKc/MIe9EpXAdbVTtPCIpyonPYZhfnEp6Dz6cIPB8p96sjq0UEniaQ0xNX8DzcE3oMNMQHk1pBwHfwu782z/M8jGwDWMq15PVszCuotWp+7Q= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561620235619177.08614753902634; Thu, 27 Jun 2019 00:23:55 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6791381F10; Thu, 27 Jun 2019 07:23:51 +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 3DA9F6090E; Thu, 27 Jun 2019 07:23: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 3F994206D2; Thu, 27 Jun 2019 07:23:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5R7NTUn021338 for ; Thu, 27 Jun 2019 03:23:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40A38608C6; Thu, 27 Jun 2019 07:23:29 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id C00E360856 for ; Thu, 27 Jun 2019 07:23:26 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 27 Jun 2019 09:23:25 +0200 Message-Id: <5f37b17897cec0511e5c6af4e1c7edc9023fe608.1561620205.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: blockjob: Don't leak 'cfg' from qemuBlockJobEventProcessLegacy 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 27 Jun 2019 07:23:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since c257352797a a reference of 'cfg' would be leaked if the function does not need to process anything. Fix it by using VIR_AUTOUNREF. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index f105632a09..d7e1070c93 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -315,7 +315,7 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, qemuBlockJobDataPtr job, int asyncJob) { - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg =3D virQEMUDriverGetConfig(d= river); virDomainDiskDefPtr disk =3D job->disk; VIR_DEBUG("disk=3D%s, mirrorState=3D%s, type=3D%d, state=3D%d, newstat= e=3D%d", @@ -368,8 +368,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, VIR_WARN("Unable to update persistent definition on vm %s " "after block job", vm->def->name); } - - virObjectUnref(cfg); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list