[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] [PATCH] Avoid two more leaks.



On Mon, Mar 03, 2008 at 11:40:35AM +0100, Jim Meyering wrote:
> Here are two more:
> 
> 	Avoid two more leaks.
> 	* src/capabilities.c (virCapabilitiesFree): Free host.migrateTrans.
> 	(virCapabilitiesFreeGuest): Free arch.name member.
> 
> Signed-off-by: Jim Meyering <meyering redhat com>
> ---
>  src/capabilities.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/src/capabilities.c b/src/capabilities.c
> index 2544bd3..bedd445 100644
> --- a/src/capabilities.c
> +++ b/src/capabilities.c
> @@ -91,6 +91,7 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest)
>      int i;
>      free(guest->ostype);
> 
> +    free(guest->arch.name);
>      free(guest->arch.defaultInfo.emulator);
>      free(guest->arch.defaultInfo.loader);
>      for (i = 0 ; i < guest->arch.defaultInfo.nmachines ; i++)
> @@ -130,6 +131,10 @@ virCapabilitiesFree(virCapsPtr caps) {
>          virCapabilitiesFreeHostNUMACell(caps->host.numaCell[i]);
>      free(caps->host.numaCell);
> 
> +    for (i = 0 ; i < caps->host.nmigrateTrans ; i++)
> +        free(caps->host.migrateTrans[i]);
> +    free(caps->host.migrateTrans);

  Okay, i would have checked caps->host.nmigrateTrans against NULL first
but it seems other code in that routine do similar things with sub
arrays, i assume it's fine then,

  +1

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]