From nobody Mon Nov 25 17:39:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1595987060; cv=none; d=zohomail.com; s=zohoarc; b=Yp6NbZeIBT+tuni548GV3ijeoeiGyFVhT+Ffc4tlmcs6RluH+itd8aL2eJw2BUggXWJXuXcqeQ0G+BOf+02FQt2LMgu1srGgITHJAUmv5Ss0KznAlp5rttMBgaNT/pNcgZxyS//zl6voXiePKfO4/tqi7/W/OvEKMdrsFzap2Og= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595987060; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=22T+xeX5kKNZB8zwbSrfNMZBZxu0W1aYFi6FdVmYtRQ=; b=X+VPfDZRjpvodvrRJRzhO/+QWfcyUurnYDZhscVmUV72w1EAkVBqdhDIgKgV9BD0NxRc7sekejjn792Dg6EqEiUV+Lk5rLvzcj3t3VBRkMEkXQEk0m2EzJwcx+ZpL1eHidpypqJE0YFYeWNSHNvnuCtQ5Ah2zUPPSjqGx652yNM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1595987060006238.7867328595338; Tue, 28 Jul 2020 18:44:20 -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-367-ssk8DSRGNqioHzK7IA7TMQ-1; Tue, 28 Jul 2020 21:44:15 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51D33100AA23; Wed, 29 Jul 2020 01:44:09 +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 5F5FF8A164; Wed, 29 Jul 2020 01:44:06 +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 BE24EA359F; Wed, 29 Jul 2020 01:44:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06T1i0Yb021482 for ; Tue, 28 Jul 2020 21:44:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id C0F3B2026E04; Wed, 29 Jul 2020 01:44:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB78B2026D5D for ; Wed, 29 Jul 2020 01:43:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C09261012443 for ; Wed, 29 Jul 2020 01:43:56 +0000 (UTC) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-j-EE7M_0Oc-w5DhG2AHOHA-1; Tue, 28 Jul 2020 21:43:54 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4FE4E7C61F9B23A7D89E for ; Wed, 29 Jul 2020 09:43:51 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Jul 2020 09:43:42 +0800 X-MC-Unique: ssk8DSRGNqioHzK7IA7TMQ-1 X-MC-Unique: j-EE7M_0Oc-w5DhG2AHOHA-1 From: Chuan Zheng To: Subject: [PATCH] qemuDomainSaveInternal: fix memoryleak of virDomainDef Date: Wed, 29 Jul 2020 09:56:06 +0800 Message-ID: <1595987766-97633-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: fangying1@huawei.com, alex.chen@huawei.com, wanghao232@huawei.com, zhang.zhanghailiang@huawei.com, yubihong@huawei.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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zheng Chuan virDomainDefPtr 'def' is forgot to free after qemuDomainDefFormatLive(), fi= x it. Signed-off-by: Zheng Chuan --- src/qemu/qemu_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 53980d4..b145318 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3369,6 +3369,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, goto endjob; } xml =3D qemuDomainDefFormatLive(driver, priv->qemuCaps, def, NULL,= true, true); + virDomainDefFree(def); } else { xml =3D qemuDomainDefFormatLive(driver, priv->qemuCaps, vm->def, priv->origCPU, true, true); --=20 1.8.3.1