[libvirt] [PATCH] lxc: plug memory leak
Alex Jia
ajia at redhat.com
Wed Nov 9 09:45:52 UTC 2011
Michal, thanks a lot:)
Regards,
Alex
----- Original Message -----
From: "Michal Privoznik" <mprivozn at redhat.com>
To: ajia at redhat.com
Cc: libvir-list at redhat.com
Sent: Wednesday, November 9, 2011 5:33:22 PM
Subject: Re: [libvirt] [PATCH] lxc: plug memory leak
On 09.11.2011 07:51, ajia at redhat.com wrote:
> From: Alex Jia <ajia at redhat.com>
>
> Detected by Coverity. Leak introduced in commit 0f31f7b.
>
> * src/lxc/lxc_driver.c: Clean up on failure.
>
> Signed-off-by: Alex Jia <ajia at redhat.com>
> ---
> src/lxc/lxc_driver.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> index 37092bc..a1d0a7c 100644
> --- a/src/lxc/lxc_driver.c
> +++ b/src/lxc/lxc_driver.c
> @@ -1850,6 +1850,7 @@ cleanup:
> }
> for (i = 0 ; i < nttyFDs ; i++)
> VIR_FORCE_CLOSE(ttyFDs[i]);
> + VIR_FREE(ttyFDs);
> VIR_FORCE_CLOSE(handshakefds[0]);
> VIR_FORCE_CLOSE(handshakefds[1]);
> VIR_FREE(logfile);
ACKed and pushed
I've changed the title to:
lxc: free 'ttyFDs' array on return from lxcVmStart
as you've sent 2 patches with same title, and I think new title express
better what has changed.
Michal
More information about the libvir-list
mailing list