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