From nobody Mon Feb 9 01:01:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1576658248; cv=none; d=zohomail.com; s=zohoarc; b=ZMIjI/TaLzt4dF7GVHmcc1izIjzbtVckwhPs18QDwSc0AaaGamRP+ue4I/es9kXnFKLl59dv3lMAfyN1Y0BtM9YRgzTa3aO9iUY+MSwbMGHB5o9bYAsZZx7e7F3k3Zd2hoow3BPOdjLXDi8MjQZPLNsWv9zGTymMjmzfhHfjpmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576658248; 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=L6C5680zti1ZebSzjJ6fbu/uRPaUcoC1swMGcoENHUE=; b=VOuH98d15WdKnlZ2um2k/I4uq5P1jJt+s75z4CIltJ4Ew3sxenHHPrxsTZfUjR3hz6g7UjQySx/MkaF4OoQr3s32DocOsCwwnuf6Y1rlS6ZnLzb5FRXvqoI5nV5dD4eelJCZXXfTfxSlx7mJrHxJMknBPgOFGhVYvPmWUCFLB3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1576658248480619.5373298177369; Wed, 18 Dec 2019 00:37:28 -0800 (PST) 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-314-KyA3iXPZMIG3idGzaBNsdQ-1; Wed, 18 Dec 2019 03:37:25 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC156DBED; Wed, 18 Dec 2019 08:37:20 +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 9181360C18; Wed, 18 Dec 2019 08:37:20 +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 9C0B51854F; Wed, 18 Dec 2019 08:37:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBI8bENM026754 for ; Wed, 18 Dec 2019 03:37:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 35AC660C81; Wed, 18 Dec 2019 08:37:14 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-155.brq.redhat.com [10.40.204.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7E3C60C18 for ; Wed, 18 Dec 2019 08:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576658247; 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=L6C5680zti1ZebSzjJ6fbu/uRPaUcoC1swMGcoENHUE=; b=amUoMef9gfanJqXUbSd568NNPC0PxpALn82/1QGcMf2yQtCX1aka+aEjsJbmoA6YM3EBo/ 9KhInZpdIMaNdPZLQIEn+ubyfJmmgs+x2Niww+zgKGaazKzf5NRjTSxwEpLe086oVGNaNs +cfRVBU2yxcsDgI8n9lsZmZuQtu1EBU= From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 18 Dec 2019 09:37:04 +0100 Message-Id: <449adb462a398020b9143fcc6ec960b90783ea9b.1576658185.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] domaincapstest: Don't leak cpu definitions 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.12 X-MC-Unique: KyA3iXPZMIG3idGzaBNsdQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When generating domain capabilities, we need to fake host CPU to get reproducible result. We do this by copying a pre-existent CPU config and setting VIR_TEST_MOCK_FAKE_HOST_CPU env variable which is then consumed by qemucpumock. However, we forget to free the CPU copy afterwards. 2,196 (2,016 direct, 180 indirect) bytes in 18 blocks are definitely lost = in loss record 291 of 297 at 0x4838B86: calloc (vg_replace_malloc.c:762) by 0x57CB6A0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6000.7) by 0x4A0F72D: virCPUDefNew (cpu_conf.c:87) by 0x4A0FAC7: virCPUDefCopyWithoutModel (cpu_conf.c:235) by 0x4A0FBBE: virCPUDefCopy (cpu_conf.c:273) by 0x10E3C0: testUtilsHostCpusGetDefForArch (testutilshostcpus.h:157) by 0x10E3C0: fakeHostCPU (domaincapstest.c:61) by 0x10E3C0: fillQemuCaps (domaincapstest.c:86) by 0x10E3C0: test_virDomainCapsFormat (domaincapstest.c:234) by 0x10F4BC: virTestRun (testutils.c:146) by 0x10DE93: doTestQemuInternal (domaincapstest.c:301) by 0x10E13D: doTestQemu (domaincapstest.c:332) by 0x1124CF: testQemuCapsIterate (testutilsqemu.c:635) by 0x10DCE3: mymain (domaincapstest.c:435) by 0x10FD8B: virTestMain (testutils.c:916) Signed-off-by: Michal Privoznik --- tests/domaincapstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index a4a443b1d6..9f5eab3230 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -56,7 +56,7 @@ fillStringValues(virDomainCapsStringValuesPtr values, ...) static int fakeHostCPU(virArch arch) { - virCPUDefPtr cpu; + g_autoptr(virCPUDef) cpu =3D NULL; =20 if (!(cpu =3D testUtilsHostCpusGetDefForArch(arch))) { virReportError(VIR_ERR_INTERNAL_ERROR, --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list