[Libvir] [PATCH] Fix some memory leaks of virsh schedinfo

Saori Fukuta fukuta.saori at jp.fujitsu.com
Fri Aug 17 11:41:41 UTC 2007


Hi,

There are some memory leaks at the virsh schedinfo command.
So I fix them.

(e.g.)
When the virDomainSetSchedulerParameters failed, the allocated
memory as params is not freed.
# valgrind --leak-check=full virsh schedinfo PV_RH5_8 --weight 0
==18879== Memcheck, a memory error detector.
==18879== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
*snip*
==18879== 92 bytes in 1 blocks are definitely lost in loss record 6 of 23
==18879==    at 0x40053C0: malloc (vg_replace_malloc.c:149)
==18879==    by 0x80531D5: _vshMalloc (virsh.c:4201)
==18879==    by 0x804BC44: cmdSchedinfo (virsh.c:1033)
==18879==    by 0x80526CF: vshCommandRun (virsh.c:3839)
==18879==    by 0x805452A: main (virsh.c:4741)
==18879==
==18879== LEAK SUMMARY:
==18879==    definitely lost: 92 bytes in 1 blocks.
==18879==      possibly lost: 0 bytes in 0 blocks.
==18879==    still reachable: 14,234 bytes in 293 blocks.
==18879==         suppressed: 0 bytes in 0 blocks.

Signed-off-by: Saori Fukuta <fukuta.saori at jp.fujitsu.com>

Thanks,
Saori Fukuta
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_schedinfo.patch
Type: application/octet-stream
Size: 2524 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070817/672c4d7c/attachment-0001.obj>


More information about the libvir-list mailing list