Re: [PATCH] cpu: plug memory leak

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

 



libvir-list-bounces@xxxxxxxxxx wrote on 01/10/2011 06:59:12 PM:

> From: Eric Blake <eblake@xxxxxxxxxx>

> To: libvir-list@xxxxxxxxxx
> Date: 01/10/2011 07:08 PM
> Subject: [PATCH] cpu: plug memory leak
> Sent by: libvir-list-bounces@xxxxxxxxxx
>
> * src/cpu/cpu_x86.c (x86ModelLoad): Free data before overwriting.
> ---
>
> Yet another valgrind finding; 320 bytes per domain XML parse.
>
>  src/cpu/cpu_x86.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
> index df1e431..ae8e5e7 100644
> --- a/src/cpu/cpu_x86.c
> +++ b/src/cpu/cpu_x86.c
> @@ -1,7 +1,7 @@
>  /*
>   * cpu_x86.c: CPU driver for CPUs with x86 compatible CPUID instruction
>   *
> - * Copyright (C) 2009-2010 Red Hat, Inc.
> + * Copyright (C) 2009-2011 Red Hat, Inc.
>   *
>   * This library is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU Lesser General Public
> @@ -973,6 +973,7 @@ x86ModelLoad(xmlXPathContextPtr ctxt,
>          VIR_FREE(name);
>
>          model->vendor = ancestor->vendor;
> +        x86DataFree(model->data);
>          if (!(model->data = ""> >              goto no_memory;
>      }

ACK
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]