From nobody Tue May 7 14:26:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1635171225; cv=none; d=zohomail.com; s=zohoarc; b=CPGRdJ9c1yHJpNNZRM36nQhk5IK+rDF4mHUDEFNzWE9PHb+b2oOneM0zbhDSBpy1wcvJrejMoCqtPd9vRcj2wLLw0k/0wA8r7MHWge8vjbw45GLZv0FPSsK187O/HbS9JhmU1+1lq26Zzd+cl0xSmxHXDsoFGiVSZcvR0gm7I94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635171225; 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; bh=mtDw0QPK0DhT9ozRzUyUcvdC77anUEgdpFzRnEYx/FE=; b=DTNqbLQlCx0TaF3T74nVZPaJoN68FpG/wQ9+dhLd/A5BVgi3aanIsSVH4eiwXW85oqb9+xL0cZDVIhZ3HniqADoJJLbUbsBeGo43gKOMOFKt4HlF54uoSLigHbEYWKGJxTYbkoO3om/eNoBDzyH43JVdvIO6U86dYXy0o3UTkg0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1635171225761619.6472105606294; Mon, 25 Oct 2021 07:13:45 -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-354-VOw8eMMCPQqcEoX85ufzsA-1; Mon, 25 Oct 2021 10:13:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA4838026AD; Mon, 25 Oct 2021 14:13:34 +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 7712B5C1A1; Mon, 25 Oct 2021 14:13:34 +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 289D64EA2A; Mon, 25 Oct 2021 14:13:32 +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 19PEDUxc007981 for ; Mon, 25 Oct 2021 10:13:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id B8F0F5C1A1; Mon, 25 Oct 2021 14:13:30 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11FE45C25D for ; Mon, 25 Oct 2021 14:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635171224; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mtDw0QPK0DhT9ozRzUyUcvdC77anUEgdpFzRnEYx/FE=; b=Ir3dh2VLiq9FZ3T0dYJBn7RrIg1oIRIfKsab2oScqvZ1T86/AC89NCPWAggr8panwQ9kPw r7ycZjCaHqcngnqkqBZXC+of3y3R4QB2zRKaMjiajzL37U3jXTnW1clAtAjS7/Xr9SgyF8 fAy29GOVBD2WjiX4tOxKFk/4FtUq1E0= X-MC-Unique: VOw8eMMCPQqcEoX85ufzsA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemublocktest: Don't leak 'disk' in testQemuImageCreateLoadDiskXML Date: Mon, 25 Oct 2021 16:13:28 +0200 Message-Id: <8e3a7c6db990d0e43a765d3ba9e89b920a4e4364.1635171184.git.pkrempa@redhat.com> 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.79 on 10.5.11.16 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: 1635171226662100001 Content-Type: text/plain; charset="utf-8" The function returns only the source portion but forgot to free the disk wrapper. Fixes: 9696427ad67196 Signed-off-by: Peter Krempa --- Pushed as a trivial CI fix. tests/qemublocktest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 0176fbd3f4..9d3c2fe6b0 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -473,7 +473,7 @@ testQemuImageCreateLoadDiskXML(const char *name, virDomainXMLOption *xmlopt) { - virDomainDiskDef *disk =3D NULL; + g_autoptr(virDomainDiskDef) disk =3D NULL; g_autofree char *xmlpath =3D NULL; g_autofree char *xmlstr =3D NULL; @@ -490,7 +490,7 @@ testQemuImageCreateLoadDiskXML(const char *name, if (qemuDomainDeviceDiskDefPostParse(disk, 0) < 0) return NULL; - return disk->src; + return g_steal_pointer(&disk->src); } --=20 2.31.1