[Libvirt-cim] [PATCH] VirtualSystemManagementService: Fix yet another possible leak

Sharad Mishra snmishra at us.ibm.com
Wed Aug 24 16:58:53 UTC 2011


+1

Eduardo, I remember you telling me that you have run cimtests successfully
with this patch, correct?

Sharad Mishra
Open Virtualization
Linux Technology Center
IBM

libvirt-cim-bounces at redhat.com wrote on 08/23/2011 08:12:19 AM:

> "Eduardo Lima \(Etrunko\)" <eblima at linux.vnet.ibm.com>
> Sent by: libvirt-cim-bounces at redhat.com
>
> 08/23/11 08:12 AM
>
> Please respond to
> List for discussion and development of libvirt CIM
<libvirt-cim at redhat.com>
>
> To
>
> libvirt-cim at redhat.com
>
> cc
>
> Subject
>
> [Libvirt-cim] [PATCH] VirtualSystemManagementService: Fix yet
> another possible leak
>
> # HG changeset patch
> # User Eduardo Lima (Etrunko) <eblima at br.ibm.com>
> # Date 1314112289 10800
> # Node ID 277b56b3863b5f81a3faa18aeb7b9951b963b489
> # Parent  a346baf140d64177a9dc1066677c307ee6518236
> VirtualSystemManagementService: Fix yet another possible leak
>
> Signed-off-by: Eduardo Lima (Etrunko) <eblima at br.ibm.com>
>
> diff --git a/src/Virt_VirtualSystemManagementService.c b/src/
> Virt_VirtualSystemManagementService.c
> --- a/src/Virt_VirtualSystemManagementService.c
> +++ b/src/Virt_VirtualSystemManagementService.c
> @@ -1377,7 +1377,11 @@
>          if (tmp == NULL)
>                  return false;
>
> -        memcpy(tmp, *list, sizeof(*tmp) * cur);
> +        if (*list) {
> +                memcpy(tmp, *list, sizeof(*tmp) * cur);
> +                free(*list);
> +        }
> +
>          *list = tmp;
>
>          return true;
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20110824/08c6301e/attachment.htm>


More information about the Libvirt-cim mailing list