[Libguestfs] [PATCH] xfs: fix a possible memory leak

Richard W.M. Jones
Sat, 11 Aug 2012 11:45:59 -0000

On Mon, Aug 06, 2012 at 04:23:20PM +0800, Wanlong Gao
wrote:
> free out when failure.
>
> Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
> ---
>  daemon/xfs.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/daemon/xfs.c b/daemon/xfs.c
> index 73ba791..b331b9b 100644
> --- a/daemon/xfs.c
> +++ b/daemon/xfs.c
> @@ -457,5 +457,6 @@ do_xfs_growfs (const char *path,
>  error:
>    if (buf) free (buf);
>    if (err) free (err);
> +  if (out) free (out);
>    return NULL;
>  }
> --
> 1.7.12.rc1

Thanks, applied and I'll push it shortly.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org