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

Re: [Xen-devel] [PATCH V4 02/24] libxl: fix memory leak in libxl_cpuid_dispose



On Thu, 2014-05-01 at 13:57 +0100, Wei Liu wrote:
> libxl_cpuid_policy_list is not allocated with GC-aware allocation so it
> needs to be freed manually, just like what libxl_string_list_dispose and
> libxl_key_value_list_dispose do.
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>

The number of indirections in these functions always confuses me, but I
suppose I agree:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/libxl_cpuid.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
> index dd21b78..8a59c4d 100644
> --- a/tools/libxl/libxl_cpuid.c
> +++ b/tools/libxl/libxl_cpuid.c
> @@ -26,6 +26,7 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list 
> *p_cpuid_list)
>              if (cpuid_list[i].policy[j] != NULL)
>                  free(cpuid_list[i].policy[j]);
>      }
> +    free(cpuid_list);
>      return;
>  }
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.