[libvirt] [PATCH] tools: don't leak @cpumap

Wang King posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170412073609.30416-1-king.wang@huawei.com
tools/virsh-domain.c | 1 +
1 file changed, 1 insertion(+)
[libvirt] [PATCH] tools: don't leak @cpumap
Posted by Wang King 7 years ago
==18591== 16 bytes in 1 blocks are definitely lost in loss record 41 of 183
==18591==    at 0x4C2B934: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18591==    by 0x54EBB1C: virAllocN (viralloc.c:191)
==18591==    by 0x1628CA: _vshMalloc (vsh.c:136)
==18591==    by 0x1344C4: virshVcpuPinQuery (virsh-domain.c:6603)
==18591==    by 0x1344C4: cmdVcpuPin (virsh-domain.c:6707)
==18591==    by 0x1631BF: vshCommandRun (vsh.c:1312)
==18591==    by 0x12DBB1: main (virsh.c:961)
---
 tools/virsh-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4b6c13c..e5fb11a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6618,6 +6618,7 @@ virshVcpuPinQuery(vshControl *ctl,
         }
     }
 
+    VIR_FREE(cpumap);
     return ret;
 }
 
-- 
2.8.3


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] tools: don't leak @cpumap
Posted by Peter Krempa 7 years ago
On Wed, Apr 12, 2017 at 15:36:09 +0800, Wang King wrote:

I'll tweak the subject slightly ...

> ==18591== 16 bytes in 1 blocks are definitely lost in loss record 41 of 183
> ==18591==    at 0x4C2B934: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==18591==    by 0x54EBB1C: virAllocN (viralloc.c:191)
> ==18591==    by 0x1628CA: _vshMalloc (vsh.c:136)
> ==18591==    by 0x1344C4: virshVcpuPinQuery (virsh-domain.c:6603)
> ==18591==    by 0x1344C4: cmdVcpuPin (virsh-domain.c:6707)
> ==18591==    by 0x1631BF: vshCommandRun (vsh.c:1312)
> ==18591==    by 0x12DBB1: main (virsh.c:961)
> ---
>  tools/virsh-domain.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 4b6c13c..e5fb11a 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -6618,6 +6618,7 @@ virshVcpuPinQuery(vshControl *ctl,
>          }
>      }
>  
> +    VIR_FREE(cpumap);
>      return ret;

ACK, I'll push this soon;
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list