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

Re: [Xen-devel] [PATCH 04/13] libxl: don't leak p in libxl__wait_for_backend



On 01/12/2013 10:14, Matthew Daley wrote:
> Coverity-ID: 1055891
> Signed-off-by: Matthew Daley <mattd@xxxxxxxxxxx>

As with my " tools/libxl: Fix libxl__device_nic_from_xs_be()" patch, I
feel the suggestion will be to use libxl__xs_read_checked() instead,
given all the libxl GC machinery already around.

~Andrew

> ---
>  tools/libxl/libxl_device.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index d995c83..072b5e3 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -1219,6 +1219,7 @@ int libxl__wait_for_backend(libxl__gc *gc, char 
> *be_path, char *state)
>              goto out;
>          } else {
>              if (!strcmp(p, state)) {
> +                free(p);
>                  rc = 0;
>                  goto out;
>              } else {
> @@ -1226,6 +1227,8 @@ int libxl__wait_for_backend(libxl__gc *gc, char 
> *be_path, char *state)
>                  watchdog--;
>              }
>          }
> +
> +        free(p);
>      }
>      LOG(ERROR, "Backend %s not ready", be_path);
>  out:


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