From nobody Fri Apr 19 20:26:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1574696515; cv=none; d=zohomail.com; s=zohoarc; b=aMzyGfdMxkVO3YyYEJqWi7YOaeigMnof3D44RXjJeY6ZpULtAOwDQSuAs0ZeRaBtg5rilwvwmKOnylXyVKSCEWYKMn7UDElsd6TbBudeLPG6HC9+T9Eox0+6k4pNGMy79Jdhe+kF62H5MYwbva9ELw5ydXtOWUR6dRe/yJGYbv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574696515; 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=OhFvekuwqmcFMEV0WORQNPJLZkX1/kFp8MiUiYQqADQ=; b=nbNIvudgF0HRK0SaFN1aXBaqFc7boD8ebcmc3uJrUMSPYKshjiLJJTRewZZFYvNIxUKTg4uNQzbLRB59f0FWBgbV6Su9nEfLEwFOZ+HUkOVCdG4tMqYPCEPtv6ZkVtjxGefYnXs4BsROnlITblhPhxcpIoBDVje63ueZnbwDu5g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1574696515176321.0787868864978; Mon, 25 Nov 2019 07:41:55 -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-303-05SGNOmdNt2fBFiHgyr4Vw-1; Mon, 25 Nov 2019 10:41:51 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83D03803AAD; Mon, 25 Nov 2019 15:41:45 +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 5AD5D19C7F; Mon, 25 Nov 2019 15:41:45 +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 9C30018089CD; Mon, 25 Nov 2019 15:41:44 +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 xAPFfhIw023595 for ; Mon, 25 Nov 2019 10:41:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 89DE260878; Mon, 25 Nov 2019 15:41:43 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FB7E60872 for ; Mon, 25 Nov 2019 15:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574696514; 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=OhFvekuwqmcFMEV0WORQNPJLZkX1/kFp8MiUiYQqADQ=; b=FFfAeRkJc4jttCUrauNdjqTFvAlTQICxQ/JR8F/YRnyYUAmimk/agzhchcSCj1whvyZrXo DyQGQT9tImEH3WG8WPAcvLlPqvw+oTpLOaOaq2y42HqTg/RQcoiiKgMnVm9QUGY3fM7YDV qQqC8UZAYWW5lfRxBu+PyzAU+fUZGSA= From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:41:33 +0100 Message-Id: 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_capabilities: Use proper free function for caps->cpuModels 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.84 on 10.5.11.23 X-MC-Unique: 05SGNOmdNt2fBFiHgyr4Vw-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" The cpuModels member of _virQEMUCapsAccel struct is not a virObject but regular struct with a free function defined: qemuMonitorCPUDefsFree(). Use that when clearing parent structure instead of virObjectUnref() to avoid a memleak: =3D=3D212322=3D=3D 57,275 (48 direct, 57,227 indirect) bytes in 3 blocks ar= e definitely lost in loss record 623 of 627 =3D=3D212322=3D=3D at 0x4838B86: calloc (vg_replace_malloc.c:762) =3D=3D212322=3D=3D by 0x554A158: g_malloc0 (in /usr/lib64/libglib-2.0.so= .0.6000.6) =3D=3D212322=3D=3D by 0x17B14BF5: qemuMonitorCPUDefsNew (qemu_monitor.c:= 3587) =3D=3D212322=3D=3D by 0x17B27BA7: qemuMonitorJSONGetCPUDefinitions (qemu= _monitor_json.c:5616) =3D=3D212322=3D=3D by 0x17B14B0B: qemuMonitorGetCPUDefinitions (qemu_mon= itor.c:3559) =3D=3D212322=3D=3D by 0x17A6AFBB: virQEMUCapsFetchCPUDefinitions (qemu_c= apabilities.c:2571) =3D=3D212322=3D=3D by 0x17A6B2CC: virQEMUCapsProbeQMPCPUDefinitions (qem= u_capabilities.c:2629) =3D=3D212322=3D=3D by 0x17A70C00: virQEMUCapsInitQMPMonitorTCG (qemu_cap= abilities.c:4769) =3D=3D212322=3D=3D by 0x17A70DDF: virQEMUCapsInitQMPSingle (qemu_capabil= ities.c:4820) =3D=3D212322=3D=3D by 0x17A70E99: virQEMUCapsInitQMP (qemu_capabilities.= c:4848) =3D=3D212322=3D=3D by 0x17A71044: virQEMUCapsNewForBinaryInternal (qemu_= capabilities.c:4891) =3D=3D212322=3D=3D by 0x17A7119C: virQEMUCapsNewData (qemu_capabilities.= c:4923) Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e5f19ddcaa..f65af5c228 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1798,7 +1798,7 @@ virQEMUCapsAccelClear(virQEMUCapsAccelPtr caps) VIR_FREE(caps->machineTypes); =20 virQEMUCapsHostCPUDataClear(&caps->hostCPU); - virObjectUnref(caps->cpuModels); + qemuMonitorCPUDefsFree(caps->cpuModels); } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list