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

Re: [libvirt] [PATCH] qemu: Fix memory leak in qemuProcessWaitForMonitor



On Thu, Jun 23, 2011 at 04:48:14PM +0800, Osier Yang wrote:
> Move "VIR_FREE(buf) into label "closelog", so that "buf" could be
> freed before returning.
> ---
>  src/qemu/qemu_process.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index b441137..7885d88 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -1122,9 +1122,9 @@ cleanup:
>          ret = -1;
>      }
>  
> +closelog:
>      VIR_FREE(buf);
>  
> -closelog:
>      if (VIR_CLOSE(logfd) < 0) {
>          char ebuf[1024];
>          VIR_WARN("Unable to close logfile: %s",

  ACK, buf is always allocated on those exit paths

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


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