From nobody Fri May 3 10:33:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600944865; cv=none; d=zohomail.com; s=zohoarc; b=jYdq/fIssCmLjeOOcDjlUCKKjpWWmR3TCE5KLrHR5n6IpnAja/3FqtBtaxvkVkpEZZr+FL3+Zf9CJ2rXNyo8u6OFyM7/Mo0b/da5KyU4T8MqSL0vx+30mWVc6qTFqnnD9BUbEBEB1M/9Yen8H1C2TUwxlbTVzg6Lg3Rs/B8N4R4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600944865; 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=UW9oF5zLZXOe7ABjFbZ3uy4EARVo2ozijVWxTWzg5aY=; b=nci1YBKhgCSCUVFuAsRby1wo7wgGXIhLzoIRK3RosS33u5RJJW3dtznVN8CQjUU+TfaaiwFCVACm5RrejWySSAOXj89ezqrOSX7OiV89KG0MAecHoRf14fR2146tfstft6cKsKV/fulRp5+/pD92SWHRcx8hjcPwzuWW/mQMOo8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600944865288692.434383492196; Thu, 24 Sep 2020 03:54:25 -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-295-MVyL3VqEOj-KbgMIDq1UXQ-1; Thu, 24 Sep 2020 06:54:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37A88186DD35; Thu, 24 Sep 2020 10:54:16 +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 15E58702E7; Thu, 24 Sep 2020 10:54:16 +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 D895D44A73; Thu, 24 Sep 2020 10:54:15 +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 08OAsDjP003191 for ; Thu, 24 Sep 2020 06:54:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id CAFA51002382; Thu, 24 Sep 2020 10:54:13 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C4C31002C03 for ; Thu, 24 Sep 2020 10:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600944864; 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=UW9oF5zLZXOe7ABjFbZ3uy4EARVo2ozijVWxTWzg5aY=; b=VwusTLuHGXcchvYNQ5emGN1fdaPb65beARO93IAczx1j4h7VMbwG1WKx31u6/0/A3wuU9a XaSVy4FX9McevmZC6zsAtLDp2poZ2fPXNqV06aQlapi3EVGjfZHCDP2W3A7W2iVyTz6fzj 13gqGttKjE6WjCuaUQR0nvqaNdbq2/s= X-MC-Unique: MVyL3VqEOj-KbgMIDq1UXQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuSnapshotDiskContextCleanup: Don't leak snapctxt Date: Thu, 24 Sep 2020 12:54:07 +0200 Message-Id: <1f5bf923d74643ce3fc86ac10a2498fc2136f689.1600944794.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.11 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) Content-Type: text/plain; charset="utf-8" The container itself needs to be freed too. Fixes: 8c2ecdf131c Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_snapshot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 0a97d3643f..63401db2a9 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -883,6 +883,8 @@ qemuSnapshotDiskContextCleanup(qemuSnapshotDiskContextP= tr snapctxt) virJSONValueFree(snapctxt->actions); qemuSnapshotDiskCleanup(snapctxt->dd, snapctxt->ndd, snapctxt->vm, sna= pctxt->asyncJob); + + g_free(snapctxt); } G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuSnapshotDiskContext, qemuSnapshotDiskCon= textCleanup); --=20 2.26.2 From nobody Fri May 3 10:33:52 2024 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=1600944864; cv=none; d=zohomail.com; s=zohoarc; b=ZI6YDYYjBM/XJ09UlAmK1iZk7RvdKVShxi4hHNBiTfE5HqTzsWMlR+io4HUq59oqcVVw8J7Vt90ZE7Y/3Q4QOJPVQH5/cyuJsJIX3gNZl6fbUhLwJ5EgOay7bnqQpY8OuzrJGQiWb+iGmVB74bbB3xriXEFQJfTsU9GuvXpfvHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600944864; 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=B4c8dBzdotKUy6uYFLVbeQM7v3BnTy+WcMtGde+yGCM=; b=XMYhWG5SsF1LkO7XEWmEH7AdmyOZ20bENFlHBE+POKnQbRYWiOknI7TcRx81tHWXPJ0vZV96mOO/TH6Pi36cYgZjH5gtFAuzU2WUlNFLLBy9PGD51aVJoEe1GKRyJTEqBfXFielYW5U5GmUNwSONuZf52qo8ipg3nIkIJKibLh0= 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 16009448646681.6946061610005927; Thu, 24 Sep 2020 03:54:24 -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-408-ZU9I5jmOPea0JuOcS0EgYA-1; Thu, 24 Sep 2020 06:54:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C916425DD; Thu, 24 Sep 2020 10:54:16 +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 6B4A35D990; Thu, 24 Sep 2020 10:54:16 +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 355481826D2B; Thu, 24 Sep 2020 10:54:16 +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 08OAsEbl003198 for ; Thu, 24 Sep 2020 06:54:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id DDC7B100239A; Thu, 24 Sep 2020 10:54:14 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FEF61002382 for ; Thu, 24 Sep 2020 10:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600944863; 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=B4c8dBzdotKUy6uYFLVbeQM7v3BnTy+WcMtGde+yGCM=; b=ScLe9TeCV1dYa8T8XxSKpbNM2dbitr470S37vZeE0fkwlWMtFsriBVaqr1PC2mIJbUoxAI b50hHgAbyRwAymOl39Z0ml1zXtwQVEembx0/AtNnmc+gXw+97devBo9qgnqeE5Iqx0402K cRSjR6w/NrZR8/Ujad6kfWAwRMxYRic= X-MC-Unique: ZU9I5jmOPea0JuOcS0EgYA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] qemuSnapshotDiskContextNew: Don't set 'ndd' Date: Thu, 24 Sep 2020 12:54:08 +0200 Message-Id: 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.14 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) Content-Type: text/plain; charset="utf-8" 'ndd' tracks the actual number of snapshot disks filled into the structure and is incremented by the functions filling the context, thus it must not be set when initializing the context. Fixes: 8c2ecdf131c Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_snapshot.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 63401db2a9..ca051071aa 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -865,7 +865,6 @@ qemuSnapshotDiskContextNew(size_t ndisks, qemuSnapshotDiskContextPtr ret =3D g_new0(qemuSnapshotDiskContext, 1); ret->dd =3D g_new0(qemuSnapshotDiskData, ndisks); - ret->ndd =3D ndisks; ret->actions =3D virJSONValueNewArray(); ret->vm =3D vm; ret->asyncJob =3D asyncJob; --=20 2.26.2