From nobody Fri Apr 19 16:11:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1554995908; cv=none; d=zoho.com; s=zohoarc; b=iq7GVMnqpa+WLbvXXCK4bjCaMtCQg8ps/98C7kb1IoamallYWny9JxCP83G47kg5yz960bn8pv0ccegnBqGMTJXl7wPPwqxHaW0lY/5F1yo2IcxjfQw8eIafWsgBrVLNlEXhDHqFGqqOCuclzklxEpxX+5q3bkA2zHDgq1ChIds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554995908; 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:ARC-Authentication-Results; bh=hqitZrq2d7oPiH4mDdBPUqk119ynYSi7chKlVLKOi+Y=; b=dOP96rzcsuR67Xc2TjpUhNdnQZ54HdwpAZEWTe0E7d4ImY/tk0As0GsuVpsq/RTnvsrJustZscGwjQq5kqWyMSAwsVbVJzVVfnD4s1jnSsELsOZPrY3jA+GtZ/EJDshlxumJb0KhdCxI81ojuX4DD6ksXXi6umXpIpfRGu1jOHU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554995908019702.8025934704121; Thu, 11 Apr 2019 08:18:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 599003078A23; Thu, 11 Apr 2019 15:18:26 +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 E598718231; Thu, 11 Apr 2019 15:18:24 +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 B4EEA181AC45; Thu, 11 Apr 2019 15:18:18 +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 x3BFHQjQ014019 for ; Thu, 11 Apr 2019 11:17:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3AE381001943; Thu, 11 Apr 2019 15:17:26 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7F561018A01 for ; Thu, 11 Apr 2019 15:17:23 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 11 Apr 2019 17:17:22 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virresctrl: fix MBA memory leak 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 11 Apr 2019 15:18:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The 'bandwidths' variable is allocated using VIR_RESIZE_N so it has to be freed as well. =3D=3D118315=3D=3D 8 bytes in 1 blocks are definitely lost in loss record 2= 99 of 2,401 =3D=3D118315=3D=3D at 0x4C29DAD: malloc (vg_replace_malloc.c:308) =3D=3D118315=3D=3D by 0x4C2C100: realloc (vg_replace_malloc.c:836) =3D=3D118315=3D=3D by 0x52C3FAF: virReallocN (viralloc.c:245) =3D=3D118315=3D=3D by 0x52C4079: virExpandN (viralloc.c:294) =3D=3D118315=3D=3D by 0x532BBA8: virResctrlAllocParseProcessMemoryBandwi= dth (virresctrl.c:1156) =3D=3D118315=3D=3D by 0x532BBA8: virResctrlAllocParseMemoryBandwidthLine= (virresctrl.c:1211) =3D=3D118315=3D=3D by 0x532BBA8: virResctrlAllocParse (virresctrl.c:1414) =3D=3D118315=3D=3D by 0x532BBA8: virResctrlAllocGetGroup (virresctrl.c:1= 446) =3D=3D118315=3D=3D by 0x532C11D: virResctrlAllocGetDefault (virresctrl.c= :1464) =3D=3D118315=3D=3D by 0x532D15E: virResctrlAllocAssign (virresctrl.c:192= 3) =3D=3D118315=3D=3D by 0x532D15E: virResctrlAllocCreate (virresctrl.c:204= 2) =3D=3D118315=3D=3D by 0x31E1ABEE: qemuProcessResctrlCreate (qemu_process= .c:2596) =3D=3D118315=3D=3D by 0x31E1ABEE: qemuProcessLaunch (qemu_process.c:6444) =3D=3D118315=3D=3D by 0x31E1E341: qemuProcessStart (qemu_process.c:6721) =3D=3D118315=3D=3D by 0x31E81315: qemuDomainObjStart.constprop.50 (qemu_= driver.c:7288) =3D=3D118315=3D=3D by 0x31E81A65: qemuDomainCreateWithFlags (qemu_driver= .c:7341) =3D=3D118315=3D=3D by 0x54DDB4B: virDomainCreate (libvirt-domain.c:6534) Signed-off-by: Pavel Hrdina --- src/util/virresctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 9e477fc064..87feb4bdcf 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -407,6 +407,7 @@ virResctrlAllocDispose(void *obj) virResctrlAllocMemBWPtr mem_bw =3D alloc->mem_bw; for (i =3D 0; i < mem_bw->nbandwidths; i++) VIR_FREE(mem_bw->bandwidths[i]); + VIR_FREE(alloc->mem_bw->bandwidths); VIR_FREE(alloc->mem_bw); } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list