[libvirt] [PATCH] virresctrl: fix MBA memory leak

Peter Krempa pkrempa at redhat.com
Fri Apr 12 10:38:36 UTC 2019


On Thu, Apr 11, 2019 at 17:17:22 +0200, Pavel Hrdina wrote:
> The 'bandwidths' variable is allocated using VIR_RESIZE_N so it has to
> be freed as well.
> 
> ==118315== 8 bytes in 1 blocks are definitely lost in loss record 299 of 2,401
> ==118315==    at 0x4C29DAD: malloc (vg_replace_malloc.c:308)
> ==118315==    by 0x4C2C100: realloc (vg_replace_malloc.c:836)
> ==118315==    by 0x52C3FAF: virReallocN (viralloc.c:245)
> ==118315==    by 0x52C4079: virExpandN (viralloc.c:294)
> ==118315==    by 0x532BBA8: virResctrlAllocParseProcessMemoryBandwidth (virresctrl.c:1156)
> ==118315==    by 0x532BBA8: virResctrlAllocParseMemoryBandwidthLine (virresctrl.c:1211)
> ==118315==    by 0x532BBA8: virResctrlAllocParse (virresctrl.c:1414)
> ==118315==    by 0x532BBA8: virResctrlAllocGetGroup (virresctrl.c:1446)
> ==118315==    by 0x532C11D: virResctrlAllocGetDefault (virresctrl.c:1464)
> ==118315==    by 0x532D15E: virResctrlAllocAssign (virresctrl.c:1923)
> ==118315==    by 0x532D15E: virResctrlAllocCreate (virresctrl.c:2042)
> ==118315==    by 0x31E1ABEE: qemuProcessResctrlCreate (qemu_process.c:2596)
> ==118315==    by 0x31E1ABEE: qemuProcessLaunch (qemu_process.c:6444)
> ==118315==    by 0x31E1E341: qemuProcessStart (qemu_process.c:6721)
> ==118315==    by 0x31E81315: qemuDomainObjStart.constprop.50 (qemu_driver.c:7288)
> ==118315==    by 0x31E81A65: qemuDomainCreateWithFlags (qemu_driver.c:7341)
> ==118315==    by 0x54DDB4B: virDomainCreate (libvirt-domain.c:6534)
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  src/util/virresctrl.c | 1 +
>  1 file changed, 1 insertion(+)

ACK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190412/1a436b89/attachment-0001.sig>


More information about the libvir-list mailing list