qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] libqtest: only call fclose() on


From: Anthony Liguori
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] libqtest: only call fclose() on open files
Date: Tue, 30 Apr 2013 09:51:08 -0500
User-agent: Notmuch/0.15.2+77~g661dcf8 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Jesse Larrew <address@hidden> writes:

> libqtest.c can segfault when calling fclose() if the pidfile wasn't
> opened successfully. This patch fixes the issue.
>
> Signed-off-by: Jesse Larrew <address@hidden>

Reviewed-by: Anthony Liguori <address@hidden>

Regards,

Anthony Liguori

> ---
>  tests/libqtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/libqtest.c b/tests/libqtest.c
> index 884f959..879ffe9 100644
> --- a/tests/libqtest.c
> +++ b/tests/libqtest.c
> @@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
>          if (fgets(buffer, sizeof(buffer), f)) {
>              pid = atoi(buffer);
>          }
> +        fclose(f);
>      }
> -    fclose(f);
>      return pid;
>  }
>  
> -- 
> 1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]