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

Re: [Xen-devel] [PATCH 8/9] xl: fix main_cpupoolcreate



On Fri, 2015-07-10 at 19:00 +0100, Wei Liu wrote:
> Don't dereference extra_config if it's NULL. Don't leak extra_config in
> the end.

Subject should be more descriptive. "xl: correct handling of
extra_config in main_cpupoolcreate" perhaps? (It's a lot easier to write
non-vague messages for patches which only do one thing)

> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
>  tools/libxl/xl_cmdimpl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 971209c..d44eb4b 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -7228,7 +7228,7 @@ int main_cpupoolcreate(int argc, char **argv)
>      else
>          config_src="command line";
>  
> -    if (strlen(extra_config)) {
> +    if (extra_config && strlen(extra_config)) {
>          if (config_len > INT_MAX - (strlen(extra_config) + 2)) {
>              fprintf(stderr, "Failed to attach extra configration\n");

There's a typo in this line of context...

>              goto out;
> @@ -7365,6 +7365,7 @@ out_cfg:
>  out:
>      free(name);
>      free(config_data);
> +    free(extra_config);
>      return rc;
>  }
>  



_______________________________________________
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®.